Skip to content

Commit 65eb451

Browse files
Merge pull request #253 from openshift-cloud-team/OCPBUGS-6698
OCPBUGS-66948: Pin IPAM CRDs to release-4.20
2 parents 7daa198 + 58d17f0 commit 65eb451

File tree

1,356 files changed

+320372
-76862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,356 files changed

+320372
-76862
lines changed

openshift/Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
BIN_DIR := bin
21
TOOLS_DIR := tools
32

43
$(RELEASE_DIR):
54
mkdir -p $(RELEASE_DIR)/
65

7-
MANIFESTS_GEN := go run ./vendor/github.com/openshift/cluster-capi-operator/manifests-gen/
6+
MANIFESTS_GEN := $(TOOLS_DIR)/bin/manifests-gen
7+
KUSTOMIZE := $(TOOLS_DIR)/bin/kustomize
8+
9+
$(TOOLS_DIR)/bin/%:
10+
$(MAKE) -C $(TOOLS_DIR) bin/$*
811

912
.PHONY: check-env
1013
check-env:
@@ -16,8 +19,21 @@ endif
1619
update-manifests-gen:
1720
cd tools && go get github.com/openshift/cluster-capi-operator/manifests-gen && go mod tidy && go mod vendor
1821

22+
.PHONY: update-ipam-ref
23+
update-ipam-ref:
24+
# Get the current HEAD of the release-4.20 branch
25+
$(eval current_head := $(shell git ls-remote https://github.com/openshift/cluster-api release-4.20 | awk '$$2 == "refs/heads/release-4.20" {print $$1}'))
26+
27+
# Pin the current head in the ipam CRD kustomize resource target
28+
sed -i "s,https://github.com/openshift/cluster-api/config/crd?ref=.*,https://github.com/openshift/cluster-api/config/crd?ref=$(current_head)," ipam/kustomization.yaml
29+
30+
.PHONY: ipam-manifests
31+
ipam-manifests: $(KUSTOMIZE)
32+
$(KUSTOMIZE) build ipam -o manifests/0000_30_cluster-api_04_crd.core-cluster-api.yaml
33+
34+
# Rebasebot runs ocp-manifests, so we make it generate ipam-manifests too
1935
.PHONY: ocp-manifests
20-
ocp-manifests: $(RELEASE_DIR) check-env ## Builds openshift specific manifests
36+
ocp-manifests: ipam-manifests $(MANIFESTS_GEN) check-env | $(RELEASE_DIR) ## Builds openshift specific manifests
2137
# Generate provider manifests.
2238
# TODO: load the provider-version dynamically at rebase time when this is invoked by the Rebase Bot during one of its lifecycle hooks.
23-
cd tools && $(MANIFESTS_GEN) --provider-name "cluster-api" --provider-type "CoreProvider" --provider-version "${PROVIDER_VERSION}" --base-path "../../" --manifests-path "../manifests" --kustomize-dir="openshift"
39+
$(MANIFESTS_GEN) --provider-name "cluster-api" --provider-type "CoreProvider" --provider-version "${PROVIDER_VERSION}" --base-path "../" --manifests-path "./manifests" --kustomize-dir="openshift"

openshift/infrastructure-components-openshift.yaml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ metadata:
88
include.release.openshift.io/single-node-developer: "true"
99
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1010
service.beta.openshift.io/inject-cabundle: "true"
11-
creationTimestamp: null
1211
labels:
1312
cluster.x-k8s.io/provider: cluster-api
1413
clusterctl.cluster.x-k8s.io: ""
@@ -5318,7 +5317,6 @@ metadata:
53185317
include.release.openshift.io/single-node-developer: "true"
53195318
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
53205319
service.beta.openshift.io/inject-cabundle: "true"
5321-
creationTimestamp: null
53225320
labels:
53235321
cluster.x-k8s.io/provider: cluster-api
53245322
clusterctl.cluster.x-k8s.io: ""
@@ -9109,7 +9107,6 @@ metadata:
91099107
include.release.openshift.io/single-node-developer: "true"
91109108
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
91119109
service.beta.openshift.io/inject-cabundle: "true"
9112-
creationTimestamp: null
91139110
labels:
91149111
cluster.x-k8s.io/provider: cluster-api
91159112
clusterctl.cluster.x-k8s.io: ""
@@ -11272,7 +11269,6 @@ metadata:
1127211269
include.release.openshift.io/single-node-developer: "true"
1127311270
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1127411271
service.beta.openshift.io/inject-cabundle: "true"
11275-
creationTimestamp: null
1127611272
labels:
1127711273
cluster.x-k8s.io/provider: cluster-api
1127811274
clusterctl.cluster.x-k8s.io: ""
@@ -13555,7 +13551,6 @@ metadata:
1355513551
include.release.openshift.io/single-node-developer: "true"
1355613552
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1355713553
service.beta.openshift.io/inject-cabundle: "true"
13558-
creationTimestamp: null
1355913554
labels:
1356013555
cluster.x-k8s.io/provider: cluster-api
1356113556
clusterctl.cluster.x-k8s.io: ""
@@ -16170,7 +16165,6 @@ metadata:
1617016165
include.release.openshift.io/single-node-developer: "true"
1617116166
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1617216167
service.beta.openshift.io/inject-cabundle: "true"
16173-
creationTimestamp: null
1617416168
labels:
1617516169
cluster.x-k8s.io/provider: cluster-api
1617616170
clusterctl.cluster.x-k8s.io: ""
@@ -16971,7 +16965,6 @@ metadata:
1697116965
include.release.openshift.io/single-node-developer: "true"
1697216966
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1697316967
service.beta.openshift.io/inject-cabundle: "true"
16974-
creationTimestamp: null
1697516968
labels:
1697616969
cluster.x-k8s.io/provider: cluster-api
1697716970
clusterctl.cluster.x-k8s.io: ""
@@ -19259,7 +19252,6 @@ metadata:
1925919252
include.release.openshift.io/single-node-developer: "true"
1926019253
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
1926119254
service.beta.openshift.io/inject-cabundle: "true"
19262-
creationTimestamp: null
1926319255
labels:
1926419256
cluster.x-k8s.io/provider: cluster-api
1926519257
clusterctl.cluster.x-k8s.io: ""
@@ -20174,7 +20166,6 @@ metadata:
2017420166
include.release.openshift.io/single-node-developer: "true"
2017520167
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
2017620168
service.beta.openshift.io/inject-cabundle: "true"
20177-
creationTimestamp: null
2017820169
labels:
2017920170
cluster.x-k8s.io/provider: cluster-api
2018020171
clusterctl.cluster.x-k8s.io: ""
@@ -20620,7 +20611,6 @@ metadata:
2062020611
include.release.openshift.io/single-node-developer: "true"
2062120612
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
2062220613
service.beta.openshift.io/inject-cabundle: "true"
20623-
creationTimestamp: null
2062420614
labels:
2062520615
cluster.x-k8s.io/provider: cluster-api
2062620616
clusterctl.cluster.x-k8s.io: ""
@@ -22066,7 +22056,6 @@ metadata:
2206622056
include.release.openshift.io/single-node-developer: "true"
2206722057
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
2206822058
service.beta.openshift.io/inject-cabundle: "true"
22069-
creationTimestamp: null
2207022059
labels:
2207122060
cluster.x-k8s.io/provider: cluster-api
2207222061
clusterctl.cluster.x-k8s.io: ""
@@ -22819,8 +22808,8 @@ metadata:
2281922808
exclude.release.openshift.io/internal-openshift-hosted: "true"
2282022809
include.release.openshift.io/self-managed-high-availability: "true"
2282122810
include.release.openshift.io/single-node-developer: "true"
22811+
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
2282222812
service.beta.openshift.io/inject-cabundle: "true"
22823-
creationTimestamp: null
2282422813
labels:
2282522814
cluster.x-k8s.io/provider: cluster-api
2282622815
clusterctl.cluster.x-k8s.io: ""
@@ -23186,8 +23175,8 @@ metadata:
2318623175
exclude.release.openshift.io/internal-openshift-hosted: "true"
2318723176
include.release.openshift.io/self-managed-high-availability: "true"
2318823177
include.release.openshift.io/single-node-developer: "true"
23178+
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
2318923179
service.beta.openshift.io/inject-cabundle: "true"
23190-
creationTimestamp: null
2319123180
labels:
2319223181
cluster.x-k8s.io/provider: cluster-api
2319323182
clusterctl.cluster.x-k8s.io: ""
@@ -23816,7 +23805,6 @@ metadata:
2381623805
include.release.openshift.io/self-managed-high-availability: "true"
2381723806
include.release.openshift.io/single-node-developer: "true"
2381823807
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
23819-
creationTimestamp: null
2382023808
labels:
2382123809
cluster.x-k8s.io/provider: cluster-api
2382223810
clusterctl.cluster.x-k8s.io: ""
@@ -24073,7 +24061,6 @@ metadata:
2407324061
include.release.openshift.io/self-managed-high-availability: "true"
2407424062
include.release.openshift.io/single-node-developer: "true"
2407524063
release.openshift.io/feature-set: CustomNoUpgrade,TechPreviewNoUpgrade
24076-
creationTimestamp: null
2407724064
labels:
2407824065
cluster.x-k8s.io/provider: cluster-api
2407924066
clusterctl.cluster.x-k8s.io: ""
@@ -24109,7 +24096,6 @@ rules: []
2410924096
apiVersion: apps/v1
2411024097
kind: Deployment
2411124098
metadata:
24112-
creationTimestamp: null
2411324099
labels:
2411424100
cluster.x-k8s.io/provider: cluster-api
2411524101
clusterctl.cluster.x-k8s.io: ""
@@ -24127,7 +24113,6 @@ spec:
2412724113
metadata:
2412824114
annotations:
2412924115
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
24130-
creationTimestamp: null
2413124116
labels:
2413224117
cluster.x-k8s.io/provider: cluster-api
2413324118
control-plane: controller-manager
@@ -24216,7 +24201,6 @@ kind: MutatingWebhookConfiguration
2421624201
metadata:
2421724202
annotations:
2421824203
service.beta.openshift.io/inject-cabundle: "true"
24219-
creationTimestamp: null
2422024204
labels:
2422124205
cluster.x-k8s.io/provider: cluster-api
2422224206
clusterctl.cluster.x-k8s.io: ""
@@ -24404,7 +24388,6 @@ kind: ValidatingWebhookConfiguration
2440424388
metadata:
2440524389
annotations:
2440624390
service.beta.openshift.io/inject-cabundle: "true"
24407-
creationTimestamp: null
2440824391
labels:
2440924392
cluster.x-k8s.io/provider: cluster-api
2441024393
clusterctl.cluster.x-k8s.io: ""

openshift/ipam/kustomization.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
# MAPV uses the CAPI IPAM CRDs. Until CAPI reaches GA, these CRDs must be
5+
# separately installed in production clusters. This workaround can be removed
6+
# when CAPI reaches GA: they will be installed via the CAPI Operator manifests
7+
# along with all other CAPI CRDs.
8+
#
9+
# In 4.21 we bumped CAPI to a version which includes v1beta2, and therefore
10+
# requires a conversion webhook. This would break production vsphere clusters
11+
# using IPAM, because we are not yet deploying this webhook in production
12+
# clusters. As MAPV does not require the v1beta2 IPAM CRDs, we pin them at the
13+
# versions shipped in 4.20 for now.
14+
15+
commonAnnotations:
16+
# Boilerplate annotations
17+
exclude.release.openshift.io/internal-openshift-hosted: "true"
18+
include.release.openshift.io/self-managed-high-availability: "true"
19+
include.release.openshift.io/single-node-developer: "true"
20+
21+
# Instructs CVO to only install these resources in clusters with the Default
22+
# featureset. Specifically this means that they will not be installed in
23+
# (TechPreview|Custom|Dev)NoUpgrade clusters.
24+
release.openshift.io/feature-set: Default
25+
26+
resources:
27+
# Pinned at 4.20, as that was the last release which didn't have v1beta2
28+
- https://github.com/openshift/cluster-api/config/crd?ref=de1db2970e7fede7101e5a8188e74942ab6665e3
29+
30+
# Together these 2 patches remove all CRDs except those with the name suffix
31+
# '.ipam.cluster.x-k8s.io'
32+
patches:
33+
34+
# First add the local-config annotation to all CRDs.
35+
# kustomize will not emit resources with this annotation
36+
- target:
37+
kind: CustomResourceDefinition
38+
patch: |
39+
- op: "add"
40+
path: "/metadata/annotations/config.kubernetes.io~1local-config"
41+
value: "true"
42+
43+
# Then selectively remove the local-config annotation from CRDs in
44+
# ipam.cluster.x-k8s.io, meaning they will be emitted
45+
- target:
46+
kind: CustomResourceDefinition
47+
name: '.*\.ipam\.cluster\.x-k8s\.io$'
48+
patch: |
49+
- op: remove
50+
path: "/metadata/annotations/config.kubernetes.io~1local-config"

openshift/manifests/0000_30_cluster-api_04_cm.core-cluster-api.yaml

Lines changed: 2 additions & 955 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)