Skip to content

Commit 8ea748e

Browse files
Merge pull request #15 from openshift-cherrypick-robot/cherry-pick-14-to-release-4.10
[release-4.10] sync upstream main branch to downstream
2 parents 64758e1 + 221a944 commit 8ea748e

File tree

8 files changed

+88
-16
lines changed

8 files changed

+88
-16
lines changed

.github/workflows/build-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
context: .
6666
file: Dockerfile
67-
platforms: linux/amd64,linux/arm64,linux/arm/v7
67+
platforms: ${{ secrets.BUILD_PLATFORMS }}
6868
push: true
6969
tags: quay.io/csiaddons/k8s-controller:latest
7070

@@ -94,6 +94,6 @@ jobs:
9494
with:
9595
context: .
9696
file: build/Containerfile.sidecar
97-
platforms: linux/amd64,linux/arm64,linux/arm/v7
97+
platforms: ${{ secrets.BUILD_PLATFORMS }}
9898
push: true
9999
tags: quay.io/csiaddons/k8s-sidecar:latest

.github/workflows/test-build.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
jobs:
1010
build_bundle:
1111
name: build_bundle
12-
if: github.repository == 'csi-addons/kubernetes-csi-addons'
1312
runs-on: ubuntu-latest
1413
steps:
1514
- name: Check out the repo
@@ -52,7 +51,7 @@ jobs:
5251
with:
5352
context: .
5453
file: Dockerfile
55-
platforms: linux/amd64,linux/arm64,linux/arm/v7
54+
platforms: ${{ secrets.BUILD_PLATFORMS }}
5655
push: false
5756
tags: quay.io/csiaddons/k8s-controller:latest
5857

@@ -74,6 +73,6 @@ jobs:
7473
with:
7574
context: .
7675
file: build/Containerfile.sidecar
77-
platforms: linux/amd64,linux/arm64,linux/arm/v7
76+
platforms: ${{ secrets.BUILD_PLATFORMS }}
7877
push: false
7978
tags: quay.io/csiaddons/k8s-sidecar:latest

Makefile

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,36 @@ BUNDLE_IMG ?= quay.io/csiaddons/k8s-bundle
77
# set TAG to a release for consumption in the bundle
88
TAG ?= latest
99

10+
# In case the *_IMG variables can contain a full qualified container-image
11+
# resource (includes a ":"), the container-images should not use the TAG
12+
# valued. The :TAG option will only be added if no predefined version is
13+
# passed.
14+
ifneq (findstring $(CONTROLLER_IMG),:)
15+
CONTROLLER_IMG := $(CONTROLLER_IMG):$(TAG)
16+
endif
17+
18+
ifneq (findstring $(SIDECAR_IMG),:)
19+
SIDECAR_IMG := $(SIDECAR_IMG):$(TAG)
20+
endif
21+
22+
ifneq (findstring $(BUNDLE_IMG),:)
23+
BUNDLE_IMG := $(BUNDLE_IMG):$(TAG)
24+
endif
25+
1026
# the PACKAGE_NAME is included in the bundle/CSV and is used in catalogsources
1127
# for operators (like OperatorHub.io). Products that include the CSI-Addons
1228
# bundle should use a different PACKAGE_NAME to prevent conflicts.
1329
PACKAGE_NAME ?= csi-addons
1430

31+
# By setting RBAC_PROXY_IMG to a different container-image, new versions of
32+
# the kube-rbac-proxy can easily be tested. Products that include CSI-Addons
33+
# may want to provide a different location of the container-image.
34+
# The default value is set in config/default/kustomization.yaml
35+
#RBAC_PROXY_IMG ?= gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
36+
ifneq ($(RBAC_PROXY_IMG),)
37+
KUSTOMIZE_RBAC_PROXY := rbac-proxy=$(RBAC_PROXY_IMG)
38+
endif
39+
1540
# The default version of the bundle (CSV) can be found in
1641
# config/manifests/bases/csi-addons.clusterserviceversion.yaml . When tagging a
1742
# release, the bundle will be versioned with the same value as well.
@@ -63,7 +88,7 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
6388

6489
.PHONY: bundle
6590
bundle: kustomize operator-sdk
66-
cd config/manager && $(KUSTOMIZE) edit set image controller=$(CONTROLLER_IMG):$(TAG)
91+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(CONTROLLER_IMG) $(KUSTOMIZE_RBAC_PROXY)
6792
$(KUSTOMIZE) build config/default | $(OPERATOR_SDK) generate bundle --manifests --metadata --package=$(PACKAGE_NAME) $(BUNDLE_VERSION)
6893
mkdir -p ./bundle/tests/scorecard && $(KUSTOMIZE) build config/scorecard --output=./bundle/tests/scorecard/config.yaml
6994

@@ -105,27 +130,27 @@ run: manifests generate fmt vet ## Run a controller from your host.
105130

106131
.PHONY: docker-build
107132
docker-build: test ## Build docker image with the manager.
108-
docker build -t ${CONTROLLER_IMG}:${TAG} .
133+
docker build -t ${CONTROLLER_IMG} .
109134

110135
.PHONY: docker-push
111136
docker-push: ## Push docker image with the manager.
112-
docker push ${CONTROLLER_IMG}:${TAG}
137+
docker push ${CONTROLLER_IMG}
113138

114139
.PHONY: docker-build-sidecar
115140
docker-build-sidecar:
116-
docker build -f ./build/Containerfile.sidecar -t ${SIDECAR_IMG}:${TAG} .
141+
docker build -f ./build/Containerfile.sidecar -t ${SIDECAR_IMG} .
117142

118143
.PHONY: docker-push-sidecar
119144
docker-push-sidecar:
120-
docker push ${SIDECAR_IMG}:${TAG}
145+
docker push ${SIDECAR_IMG}
121146

122147
.PHONY: docker-build-bundle
123148
docker-build-bundle: bundle
124-
docker build -f ./bundle.Dockerfile -t ${BUNDLE_IMG}:${TAG} .
149+
docker build -f ./bundle.Dockerfile -t ${BUNDLE_IMG} .
125150

126151
.PHONY: docker-push-bundle
127152
docker-push-bundle:
128-
docker push ${BUNDLE_IMG}:${TAG}
153+
docker push ${BUNDLE_IMG}
129154

130155
##@ Deployment
131156

@@ -143,7 +168,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
143168

144169
.PHONY: deploy
145170
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
146-
cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG}:${TAG}
171+
cd config/manager && $(KUSTOMIZE) edit set image controller=${CONTROLLER_IMG} $(KUSTOMIZE_RBAC_PROXY)
147172
$(KUSTOMIZE) build config/default | kubectl apply -f -
148173

149174
.PHONY: undeploy

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ NAME DESIRED CURRENT R
112112
replicaset.apps/csi-addons-controller-manager-687d47b8c7 1 1 1 49s
113113
```
114114

115+
## Contributing
116+
117+
The [Contribution Guidelines](CONTRIBUTING.md) contain details on the process
118+
to contribute to this project.
119+
120+
For feature enhancements, or questions about particular features or design
121+
choices, there is a mailinglist. All regular contributors are encouraged to
122+
subscribe to the list, and participate in the discussions.
123+
124+
Subscribing can be done through the [mailman web interface][mailman] or by
125+
[sending an email to csi-addons-request@redhat.com][subscribe] with subject
126+
`subscribe`.
127+
115128
[csi_addons]: https://github.com/csi-addons/spec/
116129
[csi]: https://kubernetes-csi.github.io/docs/
117130
[operatorhub]: https://operatorhub.io/
131+
[mailman]: https://listman.redhat.com/mailman/listinfo/csi-addons
132+
[subscribe]: mailto:csi-addons-request@redhat.com?subject=subscribe

config/default/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,8 @@ vars:
7272
# kind: Service
7373
# version: v1
7474
# name: webhook-service
75+
76+
images:
77+
- name: rbac-proxy
78+
newName: gcr.io/kubebuilder/kube-rbac-proxy
79+
newTag: v0.8.0

config/default/manager_auth_proxy_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
spec:
1111
containers:
1212
- name: kube-rbac-proxy
13-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
13+
image: rbac-proxy
1414
args:
1515
- "--secure-listen-address=0.0.0.0:8443"
1616
- "--upstream=http://127.0.0.1:8080/"

config/manifests/bases/csi-addons.clusterserviceversion.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ spec:
5656
- name: CSI Addons
5757
url: https://github.com/csi-addons
5858
maintainers:
59-
- email: ndevos@redhat.com
60-
name: Niels de Vos
59+
- email: csi-addons@redhat.com
60+
name: CSI Addons Community
6161
maturity: alpha
6262
provider:
6363
name: CSI Addons Community

docs/ci.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Continuous Integration
2+
3+
## GitHub Workflows
4+
5+
The GitHub Workflows under [`.github/workflows/][workflows] contain jobs that
6+
are started when Pull-Requests are created or updated. Some of the jobs can
7+
build container-images for multiple architectures. Not everyone or all
8+
environmens wants to run the build tests for all platforms. The workflows can
9+
be configured to select platforms that the `docker/setup-buildx-action`
10+
supports.
11+
12+
For this configuration, a new Secret should be created in the GitHub
13+
Settings of the repository. 'Normal' environment variables seem not possible.
14+
15+
An example of the GitHub Secret that will build the container-images on AMD64,
16+
and both 32-bit and 64-bit Arm platforms:
17+
18+
- `BUILD_PLATFORMS`: `linux/amd64,linux/arm64,linux/arm/v7`
19+
20+
Detailed steps on creating the GitHub Secret can be found in [the GitHub
21+
Documentation][gh_doc_secret].
22+
23+
In case the `BUILD_PLATFORMS` environment variable is not set, the
24+
`docker/setup-buildx-action` action defaults to the single architecture where
25+
the workflow is run (usually `linux/amd64`).
26+
27+
[workflows]: .github/workflows/
28+
[gh_doc_secret]: https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository

0 commit comments

Comments
 (0)