Skip to content

Commit

Permalink
Add Ipv6Prefixes option support in ec2.Instance (review fixes)
Browse files Browse the repository at this point in the history
Signed-off-by: vaspahomov <vas2142553@gmail.com>
  • Loading branch information
vaspahomov committed Jan 31, 2022
1 parent 66ff502 commit 9251ac0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apis/ec2/manualv1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ type InstanceNetworkInterfaceSpecification struct {
// cannot use this option if you use the Ipv6PrefixCount option.
// +optional
// +immutable
Ipv6Prefixes []Ipv6PrefixSpecificationRequest `json:"ipv6Prefixes"`
Ipv6Prefixes []Ipv6PrefixSpecificationRequest `json:"ipv6Prefixes,omitempty"`

// The ID of the network interface.
//
Expand Down
16 changes: 8 additions & 8 deletions pkg/clients/ec2/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,16 @@ func GenerateEC2InstanceIPV6Addresses(addrs []manualv1alpha1.InstanceIPv6Address

// GenerateEC2Ipv6PrefixSpecificationRequest coverts an internal slice of Ipv6PrefixSpecificationRequest into a slice of ec2.Ipv6PrefixSpecificationRequest
func GenerateEC2Ipv6PrefixSpecificationRequest(prefixes []manualv1alpha1.Ipv6PrefixSpecificationRequest) []types.Ipv6PrefixSpecificationRequest {
if prefixes != nil {
res := make([]types.Ipv6PrefixSpecificationRequest, len(prefixes))
for i, a := range prefixes {
res[i] = types.Ipv6PrefixSpecificationRequest{
Ipv6Prefix: aws.String(a.Ipv6Prefix),
}
if len(prefixes) == 0 {
return nil
}
res := make([]types.Ipv6PrefixSpecificationRequest, len(prefixes))
for i, a := range prefixes {
res[i] = types.Ipv6PrefixSpecificationRequest{
Ipv6Prefix: aws.String(a.Ipv6Prefix),
}
return res
}
return nil
return res
}

// GenerateInstanceIPV6Addresses coverts a slice of ec2.InstanceIpv6Address into a slice of internal InstanceIPv6Address
Expand Down

0 comments on commit 9251ac0

Please sign in to comment.