Skip to content

Commit 3384355

Browse files
Merge pull request #1118 from miheer/promote-eips
NE-1798: API bump for promotion of eipAllocation from feature gates to GA.
2 parents 6f7dd70 + 48f0439 commit 3384355

17 files changed

+194
-16158
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@ require (
157157
// github.com/operator-framework/operator-sdk.
158158
replace (
159159
bitbucket.org/ww/goautoneg => github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d
160-
github.com/openshift/api => github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42
160+
github.com/openshift/api => github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0
161161
k8s.io/client-go => k8s.io/client-go v0.29.0
162162
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,8 +1662,8 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m
16621662
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
16631663
github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
16641664
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
1665-
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42 h1:6dvhH92q5/tuU1T4U1s3P3yuVO9ADiXa1hwBHLIYVYE=
1666-
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
1665+
github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0 h1:iyH3ClIXTa75VdDuYWpEZX+Y05uXKy/7o+8EWiGNVKU=
1666+
github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
16671667
github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
16681668
github.com/openshift/client-go v0.0.0-20200116152001-92a2713fa240/go.mod h1:4riOwdj99Hd/q+iAcJZfNCsQQQMwURnZV6RL4WHYS5w=
16691669
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8 h1:HGfbllzRcrJBSiwzNjBCs7sExLUxC5/1evnvlNGB0Cg=

hack/update-generated-crd.sh

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,36 @@ set -euo pipefail
44
function install_crd {
55
local SRC="$1"
66
local DST="$2"
7-
if ! diff -Naup "$SRC" "$DST"; then
8-
cp "$SRC" "$DST"
9-
echo "installed CRD: $SRC => $DST"
7+
if [[ -e "$SRC" ]]
8+
then
9+
if [[ -e "$DST" ]]
10+
then
11+
if ! diff -Naup "$SRC" "$DST"; then
12+
cp "$SRC" "$DST"
13+
echo "updated CRD: $SRC => $DST"
14+
else
15+
echo "skipped CRD that is already up to date: $DST"
16+
fi
17+
else
18+
cp "$SRC" "$DST"
19+
echo "updated CRD: $SRC => $DST"
20+
fi
21+
else
22+
if [[ -e "$DST" ]]
23+
then
24+
rm "$DST"
25+
echo "removed CRD that not vendored: $DST"
26+
else
27+
echo "skipped CRD that is not vendored: $SRC"
28+
fi
1029
fi
1130
}
1231

1332
# Can't rely on associative arrays for old Bash versions (e.g. OSX)
33+
34+
shopt -s extglob
1435
install_crd \
15-
"vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml" \
36+
vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers?(-Default).crd.yaml \
1637
"manifests/00-custom-resource-definition.yaml"
1738

1839
install_crd \

hack/verify-generated-crd.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,30 @@ set -euo pipefail
44
function verify_crd {
55
local SRC="$1"
66
local DST="$2"
7-
if ! diff -Naup "$SRC" "$DST"; then
8-
echo "invalid CRD: $SRC => $DST"
9-
exit 1
7+
if [[ -e "$SRC" ]]
8+
then
9+
if [[ -e "$DST" ]]
10+
then
11+
if ! diff -Naup "$SRC" "$DST"; then
12+
echo "inconsistent CRD: $SRC => $DST"
13+
exit 1
14+
fi
15+
else
16+
echo "missing CRD: $SRC => $DST"
17+
exit 1
18+
fi
19+
else
20+
if [[ -e "$DST" ]]
21+
then
22+
echo "extra CRD: $DST"
23+
exit 1
24+
fi
1025
fi
1126
}
1227

28+
shopt -s extglob
1329
verify_crd \
14-
"vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml" \
30+
vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers?(-Default).crd.yaml \
1531
"manifests/00-custom-resource-definition.yaml"
1632

1733
verify_crd \

manifests/00-custom-resource-definition-DevPreviewNoUpgrade.yaml

Lines changed: 0 additions & 2710 deletions
This file was deleted.

manifests/00-custom-resource-definition-TechPreviewNoUpgrade.yaml

Lines changed: 0 additions & 2710 deletions
This file was deleted.

manifests/00-custom-resource-definition.yaml

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ metadata:
77
capability.openshift.io/name: Ingress
88
include.release.openshift.io/ibm-cloud-managed: "true"
99
include.release.openshift.io/self-managed-high-availability: "true"
10-
release.openshift.io/feature-set: Default
1110
name: ingresscontrollers.operator.openshift.io
1211
spec:
1312
group: operator.openshift.io
@@ -368,6 +367,44 @@ spec:
368367
parameters for an AWS network load balancer. Present
369368
only if type is NLB.
370369
properties:
370+
eipAllocations:
371+
description: "eipAllocations is a list of IDs
372+
for Elastic IP (EIP) addresses that are assigned
373+
to the Network Load Balancer. The following
374+
restrictions apply: \n eipAllocations can only
375+
be used with external scope, not internal. An
376+
EIP can be allocated to only a single IngressController.
377+
The number of EIP allocations must match the
378+
number of subnets that are used for the load
379+
balancer. Each EIP allocation must be unique.
380+
A maximum of 10 EIP allocations are permitted.
381+
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
382+
for general information about configuration,
383+
characteristics, and limitations of Elastic
384+
IP addresses."
385+
items:
386+
description: EIPAllocation is an ID for an Elastic
387+
IP (EIP) address that can be allocated to
388+
an ELB in the AWS environment. Values must
389+
begin with `eipalloc-` followed by exactly
390+
17 hexadecimal (`[0-9a-fA-F]`) characters.
391+
maxLength: 26
392+
minLength: 26
393+
type: string
394+
x-kubernetes-validations:
395+
- message: eipAllocations should start with
396+
'eipalloc-'
397+
rule: self.startsWith('eipalloc-')
398+
- message: eipAllocations must be 'eipalloc-'
399+
followed by exactly 17 hexadecimal characters
400+
(0-9, a-f, A-F)
401+
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
402+
maxItems: 10
403+
type: array
404+
x-kubernetes-list-type: atomic
405+
x-kubernetes-validations:
406+
- message: eipAllocations cannot contain duplicates
407+
rule: self.all(x, self.exists_one(y, x == y))
371408
subnets:
372409
description: "subnets specifies the subnets to
373410
which the load balancer will attach. The subnets
@@ -444,6 +481,25 @@ spec:
444481
rule: has(self.ids) && self.ids.size() > 0 ||
445482
has(self.names) && self.names.size() > 0
446483
type: object
484+
x-kubernetes-validations:
485+
- message: number of subnets must be equal to number
486+
of eipAllocations
487+
rule: 'has(self.subnets) && has(self.subnets.ids)
488+
&& has(self.subnets.names) && has(self.eipAllocations)
489+
? size(self.subnets.ids + self.subnets.names)
490+
== size(self.eipAllocations) : true'
491+
- message: number of subnets must be equal to number
492+
of eipAllocations
493+
rule: 'has(self.subnets) && has(self.subnets.ids)
494+
&& !has(self.subnets.names) && has(self.eipAllocations)
495+
? size(self.subnets.ids) == size(self.eipAllocations)
496+
: true'
497+
- message: number of subnets must be equal to number
498+
of eipAllocations
499+
rule: 'has(self.subnets) && has(self.subnets.names)
500+
&& !has(self.subnets.ids) && has(self.eipAllocations)
501+
? size(self.subnets.names) == size(self.eipAllocations)
502+
: true'
447503
type:
448504
description: "type is the type of AWS load balancer
449505
to instantiate for an ingresscontroller. \n Valid
@@ -547,6 +603,11 @@ spec:
547603
- dnsManagementPolicy
548604
- scope
549605
type: object
606+
x-kubernetes-validations:
607+
- message: eipAllocations are forbidden when the scope is Internal.
608+
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
609+
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
610+
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
550611
nodePort:
551612
description: nodePort holds parameters for the NodePortService
552613
endpoint publishing strategy. Present only if type is NodePortService.
@@ -2172,6 +2233,44 @@ spec:
21722233
parameters for an AWS network load balancer. Present
21732234
only if type is NLB.
21742235
properties:
2236+
eipAllocations:
2237+
description: "eipAllocations is a list of IDs
2238+
for Elastic IP (EIP) addresses that are assigned
2239+
to the Network Load Balancer. The following
2240+
restrictions apply: \n eipAllocations can only
2241+
be used with external scope, not internal. An
2242+
EIP can be allocated to only a single IngressController.
2243+
The number of EIP allocations must match the
2244+
number of subnets that are used for the load
2245+
balancer. Each EIP allocation must be unique.
2246+
A maximum of 10 EIP allocations are permitted.
2247+
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
2248+
for general information about configuration,
2249+
characteristics, and limitations of Elastic
2250+
IP addresses."
2251+
items:
2252+
description: EIPAllocation is an ID for an Elastic
2253+
IP (EIP) address that can be allocated to
2254+
an ELB in the AWS environment. Values must
2255+
begin with `eipalloc-` followed by exactly
2256+
17 hexadecimal (`[0-9a-fA-F]`) characters.
2257+
maxLength: 26
2258+
minLength: 26
2259+
type: string
2260+
x-kubernetes-validations:
2261+
- message: eipAllocations should start with
2262+
'eipalloc-'
2263+
rule: self.startsWith('eipalloc-')
2264+
- message: eipAllocations must be 'eipalloc-'
2265+
followed by exactly 17 hexadecimal characters
2266+
(0-9, a-f, A-F)
2267+
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
2268+
maxItems: 10
2269+
type: array
2270+
x-kubernetes-list-type: atomic
2271+
x-kubernetes-validations:
2272+
- message: eipAllocations cannot contain duplicates
2273+
rule: self.all(x, self.exists_one(y, x == y))
21752274
subnets:
21762275
description: "subnets specifies the subnets to
21772276
which the load balancer will attach. The subnets
@@ -2248,6 +2347,25 @@ spec:
22482347
rule: has(self.ids) && self.ids.size() > 0 ||
22492348
has(self.names) && self.names.size() > 0
22502349
type: object
2350+
x-kubernetes-validations:
2351+
- message: number of subnets must be equal to number
2352+
of eipAllocations
2353+
rule: 'has(self.subnets) && has(self.subnets.ids)
2354+
&& has(self.subnets.names) && has(self.eipAllocations)
2355+
? size(self.subnets.ids + self.subnets.names)
2356+
== size(self.eipAllocations) : true'
2357+
- message: number of subnets must be equal to number
2358+
of eipAllocations
2359+
rule: 'has(self.subnets) && has(self.subnets.ids)
2360+
&& !has(self.subnets.names) && has(self.eipAllocations)
2361+
? size(self.subnets.ids) == size(self.eipAllocations)
2362+
: true'
2363+
- message: number of subnets must be equal to number
2364+
of eipAllocations
2365+
rule: 'has(self.subnets) && has(self.subnets.names)
2366+
&& !has(self.subnets.ids) && has(self.eipAllocations)
2367+
? size(self.subnets.names) == size(self.eipAllocations)
2368+
: true'
22512369
type:
22522370
description: "type is the type of AWS load balancer
22532371
to instantiate for an ingresscontroller. \n Valid
@@ -2351,6 +2469,11 @@ spec:
23512469
- dnsManagementPolicy
23522470
- scope
23532471
type: object
2472+
x-kubernetes-validations:
2473+
- message: eipAllocations are forbidden when the scope is Internal.
2474+
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
2475+
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
2476+
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
23542477
nodePort:
23552478
description: nodePort holds parameters for the NodePortService
23562479
endpoint publishing strategy. Present only if type is NodePortService.

vendor/github.com/openshift/api/Makefile

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)