Skip to content

Commit d977ac3

Browse files
build(deps): Bump sigs.k8s.io/cluster-api-provider-aws/v2 from 2.2.4 to 2.3.0 in /hack/third-party/capa (#264)
Bumps [sigs.k8s.io/cluster-api-provider-aws/v2](https://github.com/kubernetes-sigs/cluster-api-provider-aws) from 2.2.4 to 2.3.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases">sigs.k8s.io/cluster-api-provider-aws/v2's releases</a>.</em></p> <blockquote> <h2>v2.3.0</h2> <h1>Release notes for Cluster API Provider AWS (CAPA) v2.3.0</h1> <p><a href="https://cluster-api-aws.sigs.k8s.io/">Documentation</a></p> <h1>Changelog since v2.2.4</h1> <h2>Urgent Upgrade Notes</h2> <h3>(No, really, you MUST read this before you upgrade)</h3> <ul> <li>If you're using the S3 bucket functionality, the following permissions are required for the VPCEndpoint to be managed <code>ec2:CreateVpcEndpoint</code>, <code>ec2:ModifyVpcEndpoint</code>, <code>ec2:DeleteVpcEndpoints</code>, <code>ec2:DescribeVpcEndpoints</code>. Rerun clusterawsadm to update IAM permissions, or update it manually. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4577">#4577</a>, <a href="https://github.com/vincepri"><code>@​vincepri</code></a>)</li> <li>When the VPC is managed, the <code>SubnetSpec.ID</code> field can be used now to offload subnet management to the AWSCluster controller. The <code>id</code> should be set to a string that DOES NOT start with <code>subnet-</code>; the value is used to set the <code>Name</code> tag in the subnet resource and the actual AWS resource ID is stored in <code>SubnetSpec.ResourceID</code>. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4474">#4474</a>, <a href="https://github.com/vincepri"><code>@​vincepri</code></a>)</li> </ul> <h2>Changes by Kind</h2> <h3>Feature</h3> <ul> <li>AWSCluster.Spec.ControlPlaneLoadBalancer of type NLB now support setting up additional TCP listeners through AdditionalListeners (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4563">#4563</a>, <a href="https://github.com/vincepri"><code>@​vincepri</code></a>)</li> <li>Ignition v3 is now supported as a valid version. S3 Bucket to store bootstrap data can now optionally use presigned URLs instead of relying on IAM permissions for nodes and control-plane nodes. The feature is opt-in and backward compatible, if you'd like to switch using presigned URLs, set <code>AWSCluster.S3Bucket.PresignedURLDuration</code>. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4553">#4553</a>, <a href="https://github.com/vincepri"><code>@​vincepri</code></a>)</li> <li>Tag S3 bucket as owned by the cluster (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4518">#4518</a>, <a href="https://github.com/AndiDog"><code>@​AndiDog</code></a>)</li> <li>Use <code>AdditionalTags</code> for S3 buckets (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4625">#4625</a>, <a href="https://github.com/AndiDog"><code>@​AndiDog</code></a>)</li> </ul> <h3>Bug or Regression</h3> <ul> <li>Filter out reconciling events on externally managed AWSManagedClusters (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4604">#4604</a>, <a href="https://github.com/fiunchinho"><code>@​fiunchinho</code></a>)</li> <li>Fix issue with EKE e2e tests due to a issue when specifying which subnets to use. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4575">#4575</a>, <a href="https://github.com/richardcase"><code>@​richardcase</code></a>)</li> <li>Fix issues with kpromo to do with project name and fork (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4545">#4545</a>, <a href="https://github.com/richardcase"><code>@​richardcase</code></a>)</li> <li>Fix launch template reconciliation if bootstrap data secret cannot be read (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4589">#4589</a>, <a href="https://github.com/AndiDog"><code>@​AndiDog</code></a>)</li> <li>Fix: sorting the tags list to make it determined (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4579">#4579</a>, <a href="https://github.com/Skarlso"><code>@​Skarlso</code></a>)</li> </ul> <h3>Support</h3> <ul> <li>Maintainer and reviewer changes. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4536">#4536</a>, <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4598">#4598</a>, <a href="https://github.com/richardcase"><code>@​richardcase</code></a>)</li> <li>Bump CAPI to v1.5.3 (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4627">#4627</a>, <a href="https://github.com/Ankitasw"><code>@​Ankitasw</code></a>)</li> <li>Bump dependencies (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4612">#4612</a>, <a href="https://github.com/Ankitasw"><code>@​Ankitasw</code></a>)</li> <li>Update CAPA supported AMI OS: support on ubuntu2204 added, ubuntu1804 dropped (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4597">#4597</a>, <a href="https://github.com/wyike"><code>@​wyike</code></a>)</li> </ul> <h3>Other</h3> <ul> <li>Update metadata for the v2.3.0 release (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4651">#4651</a>, <a href="https://github.com/richardcase"><code>@​richardcase</code></a>)</li> <li>If you're using --verbosity (or <code>-v</code>) flags to gather more logs, the new guidelines show: warn at level 1, debug at level 4, and trace at level 5. (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4576">#4576</a>, <a href="https://github.com/vincepri"><code>@​vincepri</code></a>)</li> <li>Added verifier for action for pull request (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4634">#4634</a>, <a href="https://github.com/kranurag7"><code>@​kranurag7</code></a>)</li> <li>Use seedling emoji for dependabot pull requests (<a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/pull/4652">#4652</a>, <a href="https://github.com/kranurag7"><code>@​kranurag7</code></a>)</li> </ul> <p>The images for this release are: <code>registry.k8s.io/cluster-api-aws/cluster-api-aws-controller:v2.3.0</code></p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/2562a8bc41a9b76a25dd6b4f6ba9252a033f5ba1"><code>2562a8b</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4652">#4652</a> from kranurag7/kr/use-seedling-prefix-for-bot</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/d94afd0d14f784770ffd4be568650fde0c2cfe68"><code>d94afd0</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4651">#4651</a> from richardcase/metadata_23</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/866b3972b12483f3e03a38cf3946fce437f0e12d"><code>866b397</code></a> use seedling emoji for dependabot PRs</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/0d9500acb36e843c3b7172e9850454848ec113ec"><code>0d9500a</code></a> chore: update metadata for 2.3.0 release</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/11386903f9f78637d7eb53875aeda55d97b74f83"><code>1138690</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4634">#4634</a> from kranurag7/kr/add-pr-verify</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/a5928a0ba8a67ea12de23c7c581dee5d130e7721"><code>a5928a0</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4649">#4649</a> from kubernetes-sigs/dependabot/go_modules/hack/tool...</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/a1adef62257a8d1b102f9b565293f7836ccc9218"><code>a1adef6</code></a> build(deps): bump github.com/go-jose/go-jose/v3 in /hack/tools</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/11ec0d45ec627665c0d5b47055a61ea45e2fba57"><code>11ec0d4</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4646">#4646</a> from kubernetes-sigs/dependabot/go_modules/github.co...</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/14ca4d886e339d72f9abbe5f0fb305fa72336f14"><code>14ca4d8</code></a> Merge pull request <a href="https://redirect.github.com/kubernetes-sigs/cluster-api-provider-aws/issues/4644">#4644</a> from kubernetes-sigs/dependabot/go_modules/google.go...</li> <li><a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/commit/dc151f3d7b07967674ec1f55f34c182e29ee9e38"><code>dc151f3</code></a> build(deps): bump github.com/aws/amazon-vpc-cni-k8s</li> <li>Additional commits viewable in <a href="https://github.com/kubernetes-sigs/cluster-api-provider-aws/compare/v2.2.4...v2.3.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sigs.k8s.io/cluster-api-provider-aws/v2&package-manager=go_modules&previous-version=2.2.4&new-version=2.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jimmi Dyson <[email protected]>
1 parent 1ec8153 commit d977ac3

File tree

8 files changed

+249
-82
lines changed

8 files changed

+249
-82
lines changed

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awscluster_types.go

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ type AWSLoadBalancerSpec struct {
208208
// +optional
209209
AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"`
210210

211+
// AdditionalListeners sets the additional listeners for the control plane load balancer.
212+
// This is only applicable to Network Load Balancer (NLB) types for the time being.
213+
// +listType=map
214+
// +listMapKey=port
215+
// +optional
216+
AdditionalListeners []AdditionalListenerSpec `json:"additionalListeners,omitempty"`
217+
211218
// IngressRules sets the ingress rules for the control plane load balancer.
212219
// +optional
213220
IngressRules []IngressRule `json:"ingressRules,omitempty"`
@@ -226,6 +233,20 @@ type AWSLoadBalancerSpec struct {
226233
PreserveClientIP bool `json:"preserveClientIP,omitempty"`
227234
}
228235

236+
// AdditionalListenerSpec defines the desired state of an
237+
// additional listener on an AWS load balancer.
238+
type AdditionalListenerSpec struct {
239+
// Port sets the port for the additional listener.
240+
// +kubebuilder:validation:Minimum=1
241+
// +kubebuilder:validation:Maximum=65535
242+
Port int64 `json:"port"`
243+
// Protocol sets the protocol for the additional listener.
244+
// Currently only TCP is supported.
245+
// +kubebuilder:validation:Enum=TCP
246+
// +kubebuilder:default=TCP
247+
Protocol ELBProtocol `json:"protocol,omitempty"`
248+
}
249+
229250
// AWSClusterStatus defines the observed state of AWSCluster.
230251
type AWSClusterStatus struct {
231252
// +kubebuilder:default=false
@@ -239,11 +260,22 @@ type AWSClusterStatus struct {
239260
type S3Bucket struct {
240261
// ControlPlaneIAMInstanceProfile is a name of the IAMInstanceProfile, which will be allowed
241262
// to read control-plane node bootstrap data from S3 Bucket.
242-
ControlPlaneIAMInstanceProfile string `json:"controlPlaneIAMInstanceProfile"`
263+
// +optional
264+
ControlPlaneIAMInstanceProfile string `json:"controlPlaneIAMInstanceProfile,omitempty"`
243265

244266
// NodesIAMInstanceProfiles is a list of IAM instance profiles, which will be allowed to read
245267
// worker nodes bootstrap data from S3 Bucket.
246-
NodesIAMInstanceProfiles []string `json:"nodesIAMInstanceProfiles"`
268+
// +optional
269+
NodesIAMInstanceProfiles []string `json:"nodesIAMInstanceProfiles,omitempty"`
270+
271+
// PresignedURLDuration defines the duration for which presigned URLs are valid.
272+
//
273+
// This is used to generate presigned URLs for S3 Bucket objects, which are used by
274+
// control-plane and worker nodes to fetch bootstrap data.
275+
//
276+
// When enabled, the IAM instance profiles specified are not used.
277+
// +optional
278+
PresignedURLDuration *metav1.Duration `json:"presignedURLDuration,omitempty"`
247279

248280
// Name defines name of S3 Bucket to be created.
249281
// +kubebuilder:validation:MinLength:=3

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ type Ignition struct {
195195
//
196196
// +optional
197197
// +kubebuilder:default="2.3"
198-
// +kubebuilder:validation:Enum="2.3"
198+
// +kubebuilder:validation:Enum="2.3";"3.0";"3.1";"3.2";"3.3";"3.4"
199199
Version string `json:"version,omitempty"`
200200
}
201201

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/conditions_consts.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ const (
8787
RouteTableReconciliationFailedReason = "RouteTableReconciliationFailed"
8888
)
8989

90+
const (
91+
// VpcEndpointsReadyCondition reports successful reconciliation of vpc endpoints.
92+
// Only applicable to managed clusters.
93+
VpcEndpointsReadyCondition clusterv1.ConditionType = "VpcEndpointsReadyCondition"
94+
// VpcEndpointsReconciliationFailedReason used when any errors occur during reconciliation of vpc endpoints.
95+
VpcEndpointsReconciliationFailedReason = "VpcEndpointsReconciliationFailed"
96+
)
97+
9098
const (
9199
// SecondaryCidrsReadyCondition reports successful reconciliation of secondary CIDR blocks.
92100
// Only applicable to managed clusters.

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/network_types.go

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,36 @@ type NetworkSpec struct {
249249
// IPv6 contains ipv6 specific settings for the network.
250250
type IPv6 struct {
251251
// CidrBlock is the CIDR block provided by Amazon when VPC has enabled IPv6.
252+
// Mutually exclusive with IPAMPool.
252253
// +optional
253254
CidrBlock string `json:"cidrBlock,omitempty"`
254255

255256
// PoolID is the IP pool which must be defined in case of BYO IP is defined.
257+
// Must be specified if CidrBlock is set.
258+
// Mutually exclusive with IPAMPool.
256259
// +optional
257260
PoolID string `json:"poolId,omitempty"`
258261

259262
// EgressOnlyInternetGatewayID is the id of the egress only internet gateway associated with an IPv6 enabled VPC.
260263
// +optional
261264
EgressOnlyInternetGatewayID *string `json:"egressOnlyInternetGatewayId,omitempty"`
265+
266+
// IPAMPool defines the IPAMv6 pool to be used for VPC.
267+
// Mutually exclusive with CidrBlock.
268+
// +optional
269+
IPAMPool *IPAMPool `json:"ipamPool,omitempty"`
270+
}
271+
272+
// IPAMPool defines the IPAM pool to be used for VPC.
273+
type IPAMPool struct {
274+
// ID is the ID of the IPAM pool this provider should use to create VPC.
275+
ID string `json:"id,omitempty"`
276+
// Name is the name of the IPAM pool this provider should use to create VPC.
277+
Name string `json:"name,omitempty"`
278+
// The netmask length of the IPv4 CIDR you want to allocate to VPC from
279+
// an Amazon VPC IP Address Manager (IPAM) pool.
280+
// Defaults to /16 for IPv4 if not specified.
281+
NetmaskLength int64 `json:"netmaskLength,omitempty"`
262282
}
263283

264284
// VPCSpec configures an AWS VPC.
@@ -268,8 +288,13 @@ type VPCSpec struct {
268288

269289
// CidrBlock is the CIDR block to be used when the provider creates a managed VPC.
270290
// Defaults to 10.0.0.0/16.
291+
// Mutually exclusive with IPAMPool.
271292
CidrBlock string `json:"cidrBlock,omitempty"`
272293

294+
// IPAMPool defines the IPAMv4 pool to be used for VPC.
295+
// Mutually exclusive with CidrBlock.
296+
IPAMPool *IPAMPool `json:"ipamPool,omitempty"`
297+
273298
// IPv6 contains ipv6 specific settings for the network. Supported only in managed clusters.
274299
// This field cannot be set on AWSCluster object.
275300
// +optional
@@ -323,8 +348,20 @@ func (v *VPCSpec) IsIPv6Enabled() bool {
323348
// SubnetSpec configures an AWS Subnet.
324349
type SubnetSpec struct {
325350
// ID defines a unique identifier to reference this resource.
351+
// If you're bringing your subnet, set the AWS subnet-id here, it must start with `subnet-`.
352+
//
353+
// When the VPC is managed by CAPA, and you'd like the provider to create a subnet for you,
354+
// the id can be set to any placeholder value that does not start with `subnet-`;
355+
// upon creation, the subnet AWS identifier will be populated in the `ResourceID` field and
356+
// the `id` field is going to be used as the subnet name. If you specify a tag
357+
// called `Name`, it takes precedence.
326358
ID string `json:"id"`
327359

360+
// ResourceID is the subnet identifier from AWS, READ ONLY.
361+
// This field is populated when the provider manages the subnet.
362+
// +optional
363+
ResourceID string `json:"resourceID,omitempty"`
364+
328365
// CidrBlock is the CIDR block to be used when the provider creates a managed VPC.
329366
CidrBlock string `json:"cidrBlock,omitempty"`
330367

@@ -359,9 +396,18 @@ type SubnetSpec struct {
359396
Tags Tags `json:"tags,omitempty"`
360397
}
361398

399+
// GetResourceID returns the identifier for this subnet,
400+
// if the subnet was not created or reconciled, it returns the subnet ID.
401+
func (s *SubnetSpec) GetResourceID() string {
402+
if s.ResourceID != "" {
403+
return s.ResourceID
404+
}
405+
return s.ID
406+
}
407+
362408
// String returns a string representation of the subnet.
363409
func (s *SubnetSpec) String() string {
364-
return fmt.Sprintf("id=%s/az=%s/public=%v", s.ID, s.AvailabilityZone, s.IsPublic)
410+
return fmt.Sprintf("id=%s/az=%s/public=%v", s.GetResourceID(), s.AvailabilityZone, s.IsPublic)
365411
}
366412

367413
// Subnets is a slice of Subnet.
@@ -374,7 +420,7 @@ func (s Subnets) ToMap() map[string]*SubnetSpec {
374420
res := make(map[string]*SubnetSpec)
375421
for i := range s {
376422
x := s[i]
377-
res[x.ID] = &x
423+
res[x.GetResourceID()] = &x
378424
}
379425
return res
380426
}
@@ -383,19 +429,18 @@ func (s Subnets) ToMap() map[string]*SubnetSpec {
383429
func (s Subnets) IDs() []string {
384430
res := []string{}
385431
for _, subnet := range s {
386-
res = append(res, subnet.ID)
432+
res = append(res, subnet.GetResourceID())
387433
}
388434
return res
389435
}
390436

391437
// FindByID returns a single subnet matching the given id or nil.
392438
func (s Subnets) FindByID(id string) *SubnetSpec {
393439
for _, x := range s {
394-
if x.ID == id {
440+
if x.GetResourceID() == id {
395441
return &x
396442
}
397443
}
398-
399444
return nil
400445
}
401446

@@ -404,7 +449,9 @@ func (s Subnets) FindByID(id string) *SubnetSpec {
404449
// or if they are in the same vpc and the cidr block is the same.
405450
func (s Subnets) FindEqual(spec *SubnetSpec) *SubnetSpec {
406451
for _, x := range s {
407-
if (spec.ID != "" && x.ID == spec.ID) || (spec.CidrBlock == x.CidrBlock) || (spec.IPv6CidrBlock != "" && spec.IPv6CidrBlock == x.IPv6CidrBlock) {
452+
if (spec.GetResourceID() != "" && x.GetResourceID() == spec.GetResourceID()) ||
453+
(spec.CidrBlock == x.CidrBlock) ||
454+
(spec.IPv6CidrBlock != "" && spec.IPv6CidrBlock == x.IPv6CidrBlock) {
408455
return &x
409456
}
410457
}
@@ -543,14 +590,17 @@ var (
543590

544591
// SecurityGroupProtocolICMPv6 represents the ICMPv6 protocol in ingress rules.
545592
SecurityGroupProtocolICMPv6 = SecurityGroupProtocol("58")
593+
594+
// SecurityGroupProtocolESP represents the ESP protocol in ingress rules.
595+
SecurityGroupProtocolESP = SecurityGroupProtocol("50")
546596
)
547597

548598
// IngressRule defines an AWS ingress rule for security groups.
549599
type IngressRule struct {
550600
// Description provides extended information about the ingress rule.
551601
Description string `json:"description"`
552-
// Protocol is the protocol for the ingress rule. Accepted values are "-1" (all), "4" (IP in IP),"tcp", "udp", "icmp", and "58" (ICMPv6).
553-
// +kubebuilder:validation:Enum="-1";"4";tcp;udp;icmp;"58"
602+
// Protocol is the protocol for the ingress rule. Accepted values are "-1" (all), "4" (IP in IP),"tcp", "udp", "icmp", and "58" (ICMPv6), "50" (ESP).
603+
// +kubebuilder:validation:Enum="-1";"4";tcp;udp;icmp;"58";"50"
554604
Protocol SecurityGroupProtocol `json:"protocol"`
555605
// FromPort is the start of port range.
556606
FromPort int64 `json:"fromPort"`
@@ -659,7 +709,7 @@ func (i *IngressRule) Equals(o *IngressRule) bool {
659709
SecurityGroupProtocolICMP,
660710
SecurityGroupProtocolICMPv6:
661711
return i.FromPort == o.FromPort && i.ToPort == o.ToPort
662-
case SecurityGroupProtocolAll, SecurityGroupProtocolIPinIP:
712+
case SecurityGroupProtocolAll, SecurityGroupProtocolIPinIP, SecurityGroupProtocolESP:
663713
// FromPort / ToPort are not applicable
664714
}
665715

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,29 @@ const (
7070
MachineCreated AWSMachineProviderConditionType = "MachineCreated"
7171
)
7272

73+
const (
74+
// ExternalResourceGCAnnotation is the name of an annotation that indicates if
75+
// external resources should be garbage collected for the cluster.
76+
ExternalResourceGCAnnotation = "aws.cluster.x-k8s.io/external-resource-gc"
77+
78+
// ExternalResourceGCTasksAnnotation is the name of an annotation that indicates what
79+
// external resources tasks should be executed by garbage collector for the cluster.
80+
ExternalResourceGCTasksAnnotation = "aws.cluster.x-k8s.io/external-resource-tasks-gc"
81+
)
82+
83+
type GCTask string
84+
85+
var (
86+
// GCTaskLoadBalancer defines a task to cleaning up resources for AWS load balancers.
87+
GCTaskLoadBalancer = GCTask("load-balancer")
88+
89+
// GCTaskTargetGroup defines a task to cleaning up resources for AWS target groups.
90+
GCTaskTargetGroup = GCTask("target-group")
91+
92+
// GCTaskSecurityGroup defines a task to cleaning up resources for AWS security groups.
93+
GCTaskSecurityGroup = GCTask("security-group")
94+
)
95+
7396
// AZSelectionScheme defines the scheme of selecting AZs.
7497
type AZSelectionScheme string
7598

common/pkg/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go

Lines changed: 53 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)