Skip to content

Commit

Permalink
Bump openshift/api to promote eipAllocation to GA
Browse files Browse the repository at this point in the history
After promoting eipAllocation to GA, there are no longer any featuregated
fields in the IngressController CRD, so now we just have 1 copy of the
file, and so the hack scripts has to be modified.

Following command were run:

    go mod edit -replace=github.com/openshift/api=github.com/openshift/api@6b4a57ec20b0bfc77cb3909da4f1a9234d498571
    go mod tidy
    go mod vendor
    make generate
    make update
  • Loading branch information
miheer committed Aug 7, 2024
1 parent a01ed6c commit 48f0439
Show file tree
Hide file tree
Showing 17 changed files with 194 additions and 16,158 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ require (
// github.com/operator-framework/operator-sdk.
replace (
bitbucket.org/ww/goautoneg => github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d
github.com/openshift/api => github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42
github.com/openshift/api => github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0
k8s.io/client-go => k8s.io/client-go v0.29.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1662,8 +1662,8 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m
github.com/opencontainers/runtime-spec v0.1.2-0.20190618234442-a950415649c7/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-spec v1.0.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs=
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42 h1:6dvhH92q5/tuU1T4U1s3P3yuVO9ADiXa1hwBHLIYVYE=
github.com/openshift/api v0.0.0-20240802135124-8b2b377d9d42/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0 h1:iyH3ClIXTa75VdDuYWpEZX+Y05uXKy/7o+8EWiGNVKU=
github.com/openshift/api v0.0.0-20240806152114-6b4a57ec20b0/go.mod h1:OOh6Qopf21pSzqNVCB5gomomBXb8o5sGKZxG2KNpaXM=
github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160/go.mod h1:1CkcsT3aVebzRBzVTSbiKSkJMsC/CASqxesfqEMfJEc=
github.com/openshift/client-go v0.0.0-20200116152001-92a2713fa240/go.mod h1:4riOwdj99Hd/q+iAcJZfNCsQQQMwURnZV6RL4WHYS5w=
github.com/openshift/client-go v0.0.0-20240405120947-c67c8325cdd8 h1:HGfbllzRcrJBSiwzNjBCs7sExLUxC5/1evnvlNGB0Cg=
Expand Down
29 changes: 25 additions & 4 deletions hack/update-generated-crd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,36 @@ set -euo pipefail
function install_crd {
local SRC="$1"
local DST="$2"
if ! diff -Naup "$SRC" "$DST"; then
cp "$SRC" "$DST"
echo "installed CRD: $SRC => $DST"
if [[ -e "$SRC" ]]
then
if [[ -e "$DST" ]]
then
if ! diff -Naup "$SRC" "$DST"; then
cp "$SRC" "$DST"
echo "updated CRD: $SRC => $DST"
else
echo "skipped CRD that is already up to date: $DST"
fi
else
cp "$SRC" "$DST"
echo "updated CRD: $SRC => $DST"
fi
else
if [[ -e "$DST" ]]
then
rm "$DST"
echo "removed CRD that not vendored: $DST"
else
echo "skipped CRD that is not vendored: $SRC"
fi
fi
}

# Can't rely on associative arrays for old Bash versions (e.g. OSX)

shopt -s extglob
install_crd \
"vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml" \
vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers?(-Default).crd.yaml \
"manifests/00-custom-resource-definition.yaml"

install_crd \
Expand Down
24 changes: 20 additions & 4 deletions hack/verify-generated-crd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,30 @@ set -euo pipefail
function verify_crd {
local SRC="$1"
local DST="$2"
if ! diff -Naup "$SRC" "$DST"; then
echo "invalid CRD: $SRC => $DST"
exit 1
if [[ -e "$SRC" ]]
then
if [[ -e "$DST" ]]
then
if ! diff -Naup "$SRC" "$DST"; then
echo "inconsistent CRD: $SRC => $DST"
exit 1
fi
else
echo "missing CRD: $SRC => $DST"
exit 1
fi
else
if [[ -e "$DST" ]]
then
echo "extra CRD: $DST"
exit 1
fi
fi
}

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

verify_crd \
Expand Down
2,710 changes: 0 additions & 2,710 deletions manifests/00-custom-resource-definition-DevPreviewNoUpgrade.yaml

This file was deleted.

2,710 changes: 0 additions & 2,710 deletions manifests/00-custom-resource-definition-TechPreviewNoUpgrade.yaml

This file was deleted.

125 changes: 124 additions & 1 deletion manifests/00-custom-resource-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ metadata:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
release.openshift.io/feature-set: Default
name: ingresscontrollers.operator.openshift.io
spec:
group: operator.openshift.io
Expand Down Expand Up @@ -368,6 +367,44 @@ spec:
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eipAllocations:
description: "eipAllocations is a list of IDs
for Elastic IP (EIP) addresses that are assigned
to the Network Load Balancer. The following
restrictions apply: \n eipAllocations can only
be used with external scope, not internal. An
EIP can be allocated to only a single IngressController.
The number of EIP allocations must match the
number of subnets that are used for the load
balancer. Each EIP allocation must be unique.
A maximum of 10 EIP allocations are permitted.
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
for general information about configuration,
characteristics, and limitations of Elastic
IP addresses."
items:
description: EIPAllocation is an ID for an Elastic
IP (EIP) address that can be allocated to
an ELB in the AWS environment. Values must
begin with `eipalloc-` followed by exactly
17 hexadecimal (`[0-9a-fA-F]`) characters.
maxLength: 26
minLength: 26
type: string
x-kubernetes-validations:
- message: eipAllocations should start with
'eipalloc-'
rule: self.startsWith('eipalloc-')
- message: eipAllocations must be 'eipalloc-'
followed by exactly 17 hexadecimal characters
(0-9, a-f, A-F)
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
maxItems: 10
type: array
x-kubernetes-list-type: atomic
x-kubernetes-validations:
- message: eipAllocations cannot contain duplicates
rule: self.all(x, self.exists_one(y, x == y))
subnets:
description: "subnets specifies the subnets to
which the load balancer will attach. The subnets
Expand Down Expand Up @@ -444,6 +481,25 @@ spec:
rule: has(self.ids) && self.ids.size() > 0 ||
has(self.names) && self.names.size() > 0
type: object
x-kubernetes-validations:
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.ids)
&& has(self.subnets.names) && has(self.eipAllocations)
? size(self.subnets.ids + self.subnets.names)
== size(self.eipAllocations) : true'
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.ids)
&& !has(self.subnets.names) && has(self.eipAllocations)
? size(self.subnets.ids) == size(self.eipAllocations)
: true'
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.names)
&& !has(self.subnets.ids) && has(self.eipAllocations)
? size(self.subnets.names) == size(self.eipAllocations)
: true'
type:
description: "type is the type of AWS load balancer
to instantiate for an ingresscontroller. \n Valid
Expand Down Expand Up @@ -547,6 +603,11 @@ spec:
- dnsManagementPolicy
- scope
type: object
x-kubernetes-validations:
- message: eipAllocations are forbidden when the scope is Internal.
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
nodePort:
description: nodePort holds parameters for the NodePortService
endpoint publishing strategy. Present only if type is NodePortService.
Expand Down Expand Up @@ -2172,6 +2233,44 @@ spec:
parameters for an AWS network load balancer. Present
only if type is NLB.
properties:
eipAllocations:
description: "eipAllocations is a list of IDs
for Elastic IP (EIP) addresses that are assigned
to the Network Load Balancer. The following
restrictions apply: \n eipAllocations can only
be used with external scope, not internal. An
EIP can be allocated to only a single IngressController.
The number of EIP allocations must match the
number of subnets that are used for the load
balancer. Each EIP allocation must be unique.
A maximum of 10 EIP allocations are permitted.
\n See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html
for general information about configuration,
characteristics, and limitations of Elastic
IP addresses."
items:
description: EIPAllocation is an ID for an Elastic
IP (EIP) address that can be allocated to
an ELB in the AWS environment. Values must
begin with `eipalloc-` followed by exactly
17 hexadecimal (`[0-9a-fA-F]`) characters.
maxLength: 26
minLength: 26
type: string
x-kubernetes-validations:
- message: eipAllocations should start with
'eipalloc-'
rule: self.startsWith('eipalloc-')
- message: eipAllocations must be 'eipalloc-'
followed by exactly 17 hexadecimal characters
(0-9, a-f, A-F)
rule: self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')
maxItems: 10
type: array
x-kubernetes-list-type: atomic
x-kubernetes-validations:
- message: eipAllocations cannot contain duplicates
rule: self.all(x, self.exists_one(y, x == y))
subnets:
description: "subnets specifies the subnets to
which the load balancer will attach. The subnets
Expand Down Expand Up @@ -2248,6 +2347,25 @@ spec:
rule: has(self.ids) && self.ids.size() > 0 ||
has(self.names) && self.names.size() > 0
type: object
x-kubernetes-validations:
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.ids)
&& has(self.subnets.names) && has(self.eipAllocations)
? size(self.subnets.ids + self.subnets.names)
== size(self.eipAllocations) : true'
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.ids)
&& !has(self.subnets.names) && has(self.eipAllocations)
? size(self.subnets.ids) == size(self.eipAllocations)
: true'
- message: number of subnets must be equal to number
of eipAllocations
rule: 'has(self.subnets) && has(self.subnets.names)
&& !has(self.subnets.ids) && has(self.eipAllocations)
? size(self.subnets.names) == size(self.eipAllocations)
: true'
type:
description: "type is the type of AWS load balancer
to instantiate for an ingresscontroller. \n Valid
Expand Down Expand Up @@ -2351,6 +2469,11 @@ spec:
- dnsManagementPolicy
- scope
type: object
x-kubernetes-validations:
- message: eipAllocations are forbidden when the scope is Internal.
rule: '!has(self.scope) || self.scope != ''Internal'' || !has(self.providerParameters)
|| !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer)
|| !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)'
nodePort:
description: nodePort holds parameters for the NodePortService
endpoint publishing strategy. Present only if type is NodePortService.
Expand Down
4 changes: 3 additions & 1 deletion vendor/github.com/openshift/api/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 48f0439

Please sign in to comment.