Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing latest changes from upstream main for ceph-csi-operator #9

Merged
merged 30 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f99b371
ci: add auto generated dockerfile to gitignore
Madhu-1 Aug 5, 2024
ce0ddbc
ci: github action to push image to quay
Madhu-1 Aug 5, 2024
ca806e4
fix inline in json
Madhu-1 Aug 5, 2024
c19a1b4
Merge pull request #90 from Madhu-1/topolog
nb-ohad Aug 5, 2024
8d451db
api: add support for topology based provisioning
Madhu-1 Aug 5, 2024
4919ece
Merge pull request #91 from Madhu-1/add-topology
nb-ohad Aug 5, 2024
4dc3da8
fix: address csi addons problems in csi
Madhu-1 Aug 5, 2024
0b13d9e
Merge pull request #86 from Madhu-1/docker-build-push
nb-ohad Aug 6, 2024
6d04e9e
Merge pull request #93 from Madhu-1/fix-csiaddons
nb-ohad Aug 6, 2024
5956e66
ci: fix problem in build-push action
Madhu-1 Aug 6, 2024
6ad841c
update validation rule for confimap name
Madhu-1 Aug 6, 2024
ce98824
Driver Controller: remove empty container arguments
nb-ohad Aug 6, 2024
18430a2
Merge pull request #96 from Madhu-1/fix-push
nb-ohad Aug 6, 2024
526b2d3
Merge pull request #101 from nb-ohad/handle-empty-args
Madhu-1 Aug 6, 2024
c75f6a3
impore logging for invalid driver name
Madhu-1 Aug 6, 2024
b3e415e
Merge pull request #100 from Madhu-1/fix-53
nb-ohad Aug 6, 2024
52315cb
api: make apis into a seperate package
weirdwiz Jul 27, 2024
ac899c5
Merge pull request #102 from Madhu-1/fix-92
nb-ohad Aug 6, 2024
09ad654
Driver Controller: Fix nil ref access and remove unnecessary mem copy
nb-ohad Aug 6, 2024
21165ce
Merge pull request #94 from weirdwiz/api-package
nb-ohad Aug 6, 2024
91accca
Merge pull request #103 from nb-ohad/small-fixes
Madhu-1 Aug 7, 2024
1666b4b
Utils: fix issue with toggle owner argument order
nb-ohad Aug 6, 2024
71956cb
Driver Controller: Ensure csi config map exists
nb-ohad Aug 6, 2024
f23d80f
Merge pull request #104 from nb-ohad/csi-config-creation-in-driver
Madhu-1 Aug 7, 2024
d3cd147
api: fix camelCase issue SnapshotPolicyType
subhamkrai Aug 6, 2024
4613993
Merge pull request #97 from subhamkrai/fix-snapshot-name
Madhu-1 Aug 7, 2024
f92ddf7
remove controller runtime dependency
Madhu-1 Aug 7, 2024
d0835c9
Merge pull request #105 from Madhu-1/remove-ctrl-runtime-dep
nb-ohad Aug 7, 2024
a06beb7
generate service name as per kubernetes
Madhu-1 Aug 6, 2024
deb792a
Merge pull request #99 from Madhu-1/fix-88
nb-ohad Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: build-and-push
on:
push:
branches:
- main
- release-*
tags:
- '*'

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.repository == 'ceph/ceph-csi-operator'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Set up Image tag
run: |
echo "image tag ${{ github.ref }}"
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/heads\///')
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV
fi

- name: Build and push Docker images
run: make docker-buildx IMAGE_TAG=${{ env.IMAGE_TAG }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ go.work.sum

# Locally generated install files
dist/

# Locally generated dockerfile for multi-arch
Dockerfile.cross
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ARG TARGETARCH

WORKDIR /workspace
# Copy the Go Modules manifests

COPY api/ api/
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
Expand All @@ -13,7 +15,6 @@ RUN go mod download

# Copy the go source
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY internal/controller/ internal/controller/
COPY internal/utils/ internal/utils/

Expand Down
27 changes: 27 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module github.com/ceph/ceph-csi-operator/api

go 1.22.0

toolchain go1.22.5

require (
k8s.io/api v0.30.3
k8s.io/apimachinery v0.30.3
)

require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
91 changes: 91 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.30.3 h1:ImHwK9DCsPA9uoU3rVh4QHAHHK5dTSv1nxJUapx8hoQ=
k8s.io/api v0.30.3/go.mod h1:GPc8jlzoe5JG3pb0KJCSLX5oAFIW3/qNJITlDj8BH04=
k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc=
k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
4 changes: 0 additions & 4 deletions api/v1alpha1/cephconnection_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,3 @@ type CephConnectionList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []CephConnection `json:"items"`
}

func init() {
SchemeBuilder.Register(&CephConnection{}, &CephConnectionList{})
}
4 changes: 0 additions & 4 deletions api/v1alpha1/clientprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,3 @@ type ClientProfileList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClientProfile `json:"items"`
}

func init() {
SchemeBuilder.Register(&ClientProfile{}, &ClientProfileList{})
}
4 changes: 0 additions & 4 deletions api/v1alpha1/clientprofilemapping_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,3 @@ type ClientProfileMappingList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClientProfileMapping `json:"items"`
}

func init() {
SchemeBuilder.Register(&ClientProfileMapping{}, &ClientProfileMappingList{})
}
21 changes: 13 additions & 8 deletions api/v1alpha1/driver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,15 @@ type NodePluginResourcesSpec struct {
Plugin *corev1.ResourceRequirements `json:"plugin,omitempty"`
}

// TopologySpec defines the topology settings for the plugin pods
type TopologySpec struct {
// Domain labels define which node labels to use as domains for CSI nodeplugins to advertise their domains
//+kubebuilder:validation:Required
DomainLabels []string `json:"domainLabels,omitempty"`
}
type NodePluginSpec struct {
// Embedded common pods spec
PodCommonSpec `json:"inline"`
PodCommonSpec `json:",inline"`

// Driver's plugin daemonset update strategy, supported values are OnDelete and RollingUpdate.
// Default value is RollingUpdate with MaxAvailabile set to 1
Expand All @@ -166,6 +172,9 @@ type NodePluginSpec struct {
// Control the host mount of /etc/selinux for csi plugin pods. Defaults to false
//+kubebuilder:validation:Optional
EnableSeLinuxHostMount *bool `json:"EnableSeLinuxHostMount,omitempty"`
// Topology settings for the plugin pods
//+kubebuilder:validation:Optional
Topology *TopologySpec `json:"topology,omitempty"`
}

type ControllerPluginResourcesSpec struct {
Expand Down Expand Up @@ -199,7 +208,7 @@ type ControllerPluginResourcesSpec struct {

type ControllerPluginSpec struct {
// Embedded common pods spec
PodCommonSpec `json:"inline"`
PodCommonSpec `json:",inline"`

// Set replicas for controller plugin's deployment. Defaults to 2
//+kubebuilder:validation:Optional
Expand Down Expand Up @@ -264,7 +273,7 @@ type DriverSpec struct {
// A reference to a ConfigMap resource holding image overwrite for deployed
// containers
//+kubebuilder:validation:Optional
//+kubebuilder:validation:XValidation:rule=self.?name.orValue("") != "",message="'.name' cannot be empty"
//+kubebuilder:validation:XValidation:rule=self.name != "",message="'.name' cannot be empty"
ImageSet *corev1.LocalObjectReference `json:"imageSet,omitempty"`

// Cluster name identifier to set as metadata on the CephFS subvolume and RBD images. This will be useful in cases
Expand All @@ -285,7 +294,7 @@ type DriverSpec struct {

// Select a policy for snapshot behavior: none, autodetect, snapshot, sanpshotGroup
//+kubebuilder:validation:Optional
//+kubebuilder:validation:Enum:=none;autodetect;volumegroupsnapshot;volumesnapshot
//+kubebuilder:validation:Enum:=none;volumeGroupSnapshot;volumeSnapshot
SnapshotPolicy SnapshotPolicyType `json:"snapshotPolicy,omitempty"`

// OMAP generator will generate the omap mapping between the PV name and the RBD image.
Expand Down Expand Up @@ -379,7 +388,3 @@ type DriverList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []Driver `json:"items"`
}

func init() {
SchemeBuilder.Register(&Driver{}, &DriverList{})
}
23 changes: 21 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,36 @@ limitations under the License.
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "csi.ceph.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

// addKnownTypes adds our types to the API scheme by registering
// GroupVersion with the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion,
&CephConnection{}, &CephConnectionList{},
&ClientProfile{}, &ClientProfileList{},
&ClientProfileMapping{}, &ClientProfileMappingList{},
&Driver{}, &DriverList{},
&OperatorConfig{}, &OperatorConfigList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}

func init() {
SchemeBuilder.Register(addKnownTypes)
}
4 changes: 0 additions & 4 deletions api/v1alpha1/operatorconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,3 @@ type OperatorConfigList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []OperatorConfig `json:"items"`
}

func init() {
SchemeBuilder.Register(&OperatorConfig{}, &OperatorConfigList{})
}
27 changes: 26 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

Loading
Loading