Skip to content

Commit 166a74e

Browse files
Merge pull request #192 from shiftstack/sync-master
OCPBUGS-12772: Merge https://github.com/kubernetes/cloud-provider-openstack:master into master
2 parents 154df07 + 22bb44d commit 166a74e

File tree

1,930 files changed

+109109
-285609
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,930 files changed

+109109
-285609
lines changed

.github/workflows/pr.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
14-
15-
- name: Fetch history
16-
run: git fetch --prune --unshallow
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
1716

1817
- name: Set up Helm
19-
uses: azure/setup-helm@v1
18+
uses: azure/setup-helm@v3
2019
with:
21-
version: v3.6.1
20+
version: v3.10.0
2221

23-
- uses: actions/setup-python@v2
22+
- uses: actions/setup-python@v4
2423
with:
25-
python-version: 3.7
24+
python-version: '3.9'
25+
check-latest: true
2626

27+
# see example https://github.com/helm/chart-testing-action
2728
- name: Set up chart-testing
28-
uses: helm/chart-testing-action@v2.1.0
29+
uses: helm/chart-testing-action@v2.3.1
2930

30-
# https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md
3131
- name: Run chart-testing (lint)
32-
run: ct lint --target-branch=${GITHUB_BASE_REF} --check-version-increment=false
32+
run: ct lint --target-branch ${GITHUB_BASE_REF}

.github/workflows/release-cpo.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515

16-
- uses: actions/setup-go@v3
17-
with:
18-
go-version: 1.19
19-
20-
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v1
22-
23-
- name: Login to docker hub
24-
uses: docker/login-action@v1
25-
with:
26-
registry: docker.io
27-
username: ${{ secrets.DOCKER_USERNAME }}
28-
password: ${{ secrets.DOCKER_PASSWORD }}
29-
30-
- name: Get the version from ref
31-
id: get_version
32-
run: echo VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
33-
34-
- name: build & publish images
35-
run: |
36-
REGISTRY=docker.io/k8scloudprovider ARCHS='amd64 arm arm64 ppc64le s390x' GOOS=linux VERSION=${{ steps.get_version.outputs.VERSION }} make upload-images
37-
3816
- name: Create Release
3917
id: create_release
4018
uses: actions/create-release@v1

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Release Charts
33
on:
44
push:
55
branches:
6-
- "release-*" # Only release charts from stable branches
6+
- "master"
7+
- "release-*"
78

89
jobs:
910
release:
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: Checkout
13-
uses: actions/checkout@v2
14-
15-
- name: Fetch history
16-
run: git fetch --prune --unshallow
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
1717

1818
- name: Configure Git
1919
run: |

Dockerfile

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
################################################################################
14+
## BUILD ARGS ##
15+
################################################################################
16+
# This build arg allows the specification of a custom Golang image.
17+
ARG GOLANG_IMAGE=golang:1.20.3
18+
19+
# The distroless image on which the CPI manager image is built.
20+
#
21+
# Please do not use "latest". Explicit tags should be used to provide
22+
# deterministic builds. Follow what kubernetes uses to build
23+
# kube-controller-manager, for example for 1.27.x:
24+
# https://github.com/kubernetes/kubernetes/blob/release-1.27/build/common.sh#L99
25+
ARG DISTROLESS_IMAGE=registry.k8s.io/build-image/go-runner:v2.3.1-go1.20.3-bullseye.0
26+
27+
# We use Alpine as the source for default CA certificates and some output
28+
# images
29+
ARG ALPINE_IMAGE=alpine:3.17.3
30+
31+
# cinder-csi-plugin uses Debian as a base image
32+
ARG DEBIAN_IMAGE=registry.k8s.io/build-image/debian-base:bullseye-v1.4.3
33+
34+
################################################################################
35+
## BUILD STAGE ##
36+
################################################################################
37+
38+
# Build an image containing a common ca-certificates used by all target images
39+
# regardless of how they are built. We arbitrarily take ca-certificates from
40+
# the amd64 Alpine image.
41+
FROM --platform=linux/amd64 ${ALPINE_IMAGE} as certs
42+
RUN apk add --no-cache ca-certificates
43+
44+
45+
# Build all command targets. We build all command targets in a single build
46+
# stage for efficiency. Target images copy their binary from this image.
47+
# We use go's native cross compilation for multi-arch in this stage, so the
48+
# builder itself is always amd64
49+
FROM --platform=linux/amd64 ${GOLANG_IMAGE} as builder
50+
51+
ARG GOPROXY=https://goproxy.io,direct
52+
ARG TARGETOS
53+
ARG TARGETARCH
54+
ARG VERSION
55+
56+
WORKDIR /build
57+
COPY Makefile go.mod go.sum ./
58+
COPY cmd/ cmd/
59+
COPY pkg/ pkg/
60+
RUN make build GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=${GOPROXY} VERSION=${VERSION}
61+
62+
63+
################################################################################
64+
## TARGET IMAGES ##
65+
################################################################################
66+
67+
##
68+
## openstack-cloud-controller-manager
69+
##
70+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as openstack-cloud-controller-manager
71+
72+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
73+
COPY --from=builder /build/openstack-cloud-controller-manager /bin/openstack-cloud-controller-manager
74+
75+
LABEL name="openstack-cloud-controller-manager" \
76+
license="Apache Version 2.0" \
77+
maintainers="Kubernetes Authors" \
78+
description="OpenStack cloud controller manager" \
79+
distribution-scope="public" \
80+
summary="OpenStack cloud controller manager" \
81+
help="none"
82+
83+
CMD [ "/bin/openstack-cloud-controller-manager" ]
84+
85+
##
86+
## barbican-kms-plugin
87+
##
88+
FROM --platform=${TARGETPLATFORM} ${ALPINE_IMAGE} as barbican-kms-plugin
89+
# barbican-kms-plugin uses ALPINE instead of distroless because its entrypoint
90+
# uses a shell for environment substitution. If there are no other uses this
91+
# could be replaced by callers passing arguments explicitly.
92+
93+
COPY --from=builder /build/barbican-kms-plugin /bin/barbican-kms-plugin
94+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
95+
96+
LABEL name="barbican-kms-plugin" \
97+
license="Apache Version 2.0" \
98+
maintainers="Kubernetes Authors" \
99+
description="Barbican kms plugin" \
100+
distribution-scope="public" \
101+
summary="Barbican kms plugin" \
102+
help="none"
103+
104+
CMD ["sh", "-c", "/bin/barbican-kms-plugin --socketpath ${socketpath} --cloud-config ${cloudconfig}"]
105+
106+
##
107+
## cinder-csi-plugin
108+
##
109+
110+
# step 1: copy all necessary files from Debian distro to /dest folder
111+
# all magic heppens in tools/csi-deps.sh
112+
FROM --platform=${TARGETPLATFORM} ${DEBIAN_IMAGE} as cinder-csi-plugin-utils
113+
114+
RUN clean-install bash rsync mount udev btrfs-progs e2fsprogs xfsprogs
115+
COPY tools/csi-deps.sh /tools/csi-deps.sh
116+
RUN /tools/csi-deps.sh
117+
118+
# step 2: check if all necessary files are copied and work properly
119+
# the build have to finish without errors, but the result image will not be used
120+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin-utils-check
121+
122+
COPY --from=cinder-csi-plugin-utils /dest /
123+
COPY --from=cinder-csi-plugin-utils /bin/sh /bin/sh
124+
COPY tools/csi-deps-check.sh /tools/csi-deps-check.sh
125+
126+
SHELL ["/bin/sh"]
127+
RUN /tools/csi-deps-check.sh
128+
129+
# step 3: build tiny cinder-csi-plugin image with only necessary files
130+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin
131+
132+
# Copying csi-deps-check.sh simply ensures that the resulting image has a dependency
133+
# on cinder-csi-plugin-utils-check and therefore that the check has passed
134+
COPY --from=cinder-csi-plugin-utils-check /tools/csi-deps-check.sh /bin/csi-deps-check.sh
135+
COPY --from=cinder-csi-plugin-utils /dest /
136+
COPY --from=builder /build/cinder-csi-plugin /bin/cinder-csi-plugin
137+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
138+
139+
LABEL name="cinder-csi-plugin" \
140+
license="Apache Version 2.0" \
141+
maintainers="Kubernetes Authors" \
142+
description="Cinder CSI Plugin" \
143+
distribution-scope="public" \
144+
summary="Cinder CSI Plugin" \
145+
help="none"
146+
147+
CMD ["/bin/cinder-csi-plugin"]
148+
149+
##
150+
## k8s-keystone-auth
151+
##
152+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as k8s-keystone-auth
153+
154+
COPY --from=builder /build/k8s-keystone-auth /bin/k8s-keystone-auth
155+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
156+
157+
LABEL name="k8s-keystone-auth" \
158+
license="Apache Version 2.0" \
159+
maintainers="Kubernetes Authors" \
160+
description="K8s Keystone Auth" \
161+
distribution-scope="public" \
162+
summary="K8s Keystone Auth" \
163+
help="none"
164+
165+
EXPOSE 8443
166+
167+
CMD ["/bin/k8s-keystone-auth"]
168+
169+
##
170+
## magnum-auto-healer
171+
##
172+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as magnum-auto-healer
173+
174+
COPY --from=builder /build/magnum-auto-healer /bin/magnum-auto-healer
175+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
176+
177+
LABEL name="magnum-auto-healer" \
178+
license="Apache Version 2.0" \
179+
maintainers="Kubernetes Authors" \
180+
description="Magnum auto healer" \
181+
distribution-scope="public" \
182+
summary="Magnum auto healer" \
183+
help="none"
184+
185+
CMD ["/bin/magnum-auto-healer"]
186+
187+
##
188+
## manila-csi-plugin
189+
##
190+
FROM --platform=${TARGETPLATFORM} ${ALPINE_IMAGE} as manila-csi-plugin
191+
# manila-csi-plugin uses ALPINE because it pulls in jq and curl
192+
193+
RUN apk add --no-cache jq curl
194+
195+
COPY --from=builder /build/manila-csi-plugin /bin/manila-csi-plugin
196+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
197+
198+
LABEL name="manila-csi-plugin" \
199+
license="Apache Version 2.0" \
200+
maintainers="Kubernetes Authors" \
201+
description="Manila CSI Plugin" \
202+
distribution-scope="public" \
203+
summary="Manila CSI Plugin" \
204+
help="none"
205+
206+
ENTRYPOINT ["/bin/manila-csi-plugin"]
207+
208+
##
209+
## octavia-ingress-controller
210+
##
211+
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as octavia-ingress-controller
212+
213+
COPY --from=builder /build/octavia-ingress-controller /bin/octavia-ingress-controller
214+
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
215+
216+
LABEL name="octavia-ingress-controller" \
217+
license="Apache Version 2.0" \
218+
maintainers="Kubernetes Authors" \
219+
description="Octavia ingress controller" \
220+
distribution-scope="public" \
221+
summary="Octavia ingress controller" \
222+
help="none"
223+
224+
CMD ["/bin/octavia-ingress-controller"]

0 commit comments

Comments
 (0)