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

STOR-1020: Rebase external-provisioner to v3.4.0 for OCP 4.13 #60

Merged
merged 57 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d65f9f4
Change annotation name to allow volume mode change
RaunakShah Sep 28, 2022
828b79f
Use metrics exposed by sig-storage-lib
RaunakShah Sep 28, 2022
116bbca
Merge pull request #792 from RaunakShah/use_metrics_all
k8s-ci-robot Sep 29, 2022
96cb136
Merge pull request #791 from RaunakShah/update-annotation
k8s-ci-robot Sep 30, 2022
aa9ca6c
Fix string pointer comparison for source volume mode
RaunakShah Sep 30, 2022
014be4a
Merge pull request #793 from RaunakShah/fix-svm-bug
k8s-ci-robot Oct 3, 2022
edc5ac8
build(deps): bump actions/checkout from 2 to 3.1.0
dependabot[bot] Oct 6, 2022
c7f2dfe
build(deps): bump google.golang.org/grpc from 1.49.0 to 1.50.1
dependabot[bot] Oct 17, 2022
fb7363d
Merge pull request #797 from kubernetes-csi/dependabot/go_modules/goo…
k8s-ci-robot Oct 17, 2022
bb3185c
fix: add defence logic for PV without claime ref
Oct 14, 2022
80710c6
update sidecars to latest version
humblec Nov 3, 2022
ab5d9e2
build(deps): bump github.com/container-storage-interface/spec
dependabot[bot] Nov 4, 2022
c4361e6
build(deps): bump sigs.k8s.io/controller-runtime from 0.13.0 to 0.13.1
dependabot[bot] Nov 4, 2022
2c8be11
build(deps): bump github.com/prometheus/client_golang
dependabot[bot] Nov 9, 2022
2f2fa80
Squashed 'release-tools/' changes from d24254f6a..78c0fb714
jsafrane Nov 11, 2022
bbb3918
Merge commit 'f6fecd1886aea21e5ce19ff90bf5858475cfe630' into prow-upd…
jsafrane Nov 11, 2022
8fb84ba
Merge pull request #810 from jsafrane/prow-update-master
k8s-ci-robot Nov 11, 2022
ac8d9fa
Merge pull request #807 from kubernetes-csi/dependabot/go_modules/sig…
k8s-ci-robot Nov 11, 2022
c8bd87b
Merge pull request #809 from kubernetes-csi/dependabot/go_modules/git…
k8s-ci-robot Nov 11, 2022
666c7a6
Merge pull request #794 from kubernetes-csi/dependabot/github_actions…
k8s-ci-robot Nov 11, 2022
b4c5475
Merge pull request #802 from humblec/sidecar-update
k8s-ci-robot Nov 11, 2022
62adef4
Merge pull request #806 from kubernetes-csi/dependabot/go_modules/git…
k8s-ci-robot Nov 11, 2022
cee8ba8
Fix cve and update dependencies.
humblec Nov 12, 2022
626053a
Merge pull request #803 from humblec/gomod-update-20221103
k8s-ci-robot Nov 14, 2022
7a5443e
remove `replace` directive from the go.mod file
humblec Nov 17, 2022
eb64467
Merge pull request #816 from humblec/go-mod-replace
k8s-ci-robot Nov 17, 2022
e906839
build(deps): bump google.golang.org/grpc from 1.50.1 to 1.51.0
dependabot[bot] Nov 22, 2022
714d0bf
Merge pull request #822 from kubernetes-csi/dependabot/go_modules/goo…
k8s-ci-robot Nov 23, 2022
226b5f2
Update dependency go modules for k8s v1.26.0-rc.0
sunnylovestiramisu Nov 23, 2022
550f98c
Interface change for kubernetes/client-go@ecdc8bf
sunnylovestiramisu Nov 28, 2022
447003e
Remove replace in go.mod
sunnylovestiramisu Nov 28, 2022
bc14e47
Merge pull request #823 from sunnylovestiramisu/module-update-master
k8s-ci-robot Nov 28, 2022
ab58e0d
build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
dependabot[bot] Nov 28, 2022
3bfb915
Merge pull request #796 from zezaeoh/fix/defence-non-claimed-pv
k8s-ci-robot Nov 29, 2022
f4806b7
Alpha support for provision volumes from cross-namespace data sources
ttakahashi21 Oct 17, 2022
bbb2698
Update go.mod go.sum vendor
ttakahashi21 Dec 11, 2022
fa8fcd1
Update dependency go modules for k8s v1.26.0
sunnylovestiramisu Dec 12, 2022
df6fe81
Merge pull request #805 from ttakahashi21/KEP-3294
k8s-ci-robot Dec 12, 2022
1fcfdc8
Merge pull request #799 from kubernetes-csi/dependabot/go_modules/git…
k8s-ci-robot Dec 12, 2022
ab9c10d
fix controller_test typo to make the github action pass
humblec Dec 13, 2022
0a159f0
Merge pull request #836 from humblec/code-spell
k8s-ci-robot Dec 13, 2022
9941dc5
Upgrade go to 1.19
sunnylovestiramisu Dec 12, 2022
fa1a726
Merge pull request #834 from sunnylovestiramisu/module-update-master
k8s-ci-robot Dec 14, 2022
ddee826
build(deps): bump actions/checkout from 3.1.0 to 3.2.0
dependabot[bot] Dec 14, 2022
3edefae
Merge pull request #835 from kubernetes-csi/dependabot/github_actions…
k8s-ci-robot Dec 14, 2022
355c5cc
build(deps): bump sigs.k8s.io/controller-runtime from 0.13.1 to 0.14.0
dependabot[bot] Dec 16, 2022
6b76e94
Merge pull request #837 from kubernetes-csi/dependabot/go_modules/sig…
k8s-ci-robot Dec 16, 2022
635afde
build(deps): bump sigs.k8s.io/gateway-api from 0.6.0-rc1 to 0.6.0
dependabot[bot] Dec 22, 2022
2a2eb12
Upgrade csi-lib-utils to v0.12.0
sunnylovestiramisu Dec 22, 2022
37458c6
Merge pull request #844 from sunnylovestiramisu/module-update-master
k8s-ci-robot Dec 22, 2022
0ba2218
Merge pull request #843 from kubernetes-csi/dependabot/go_modules/sig…
k8s-ci-robot Dec 22, 2022
02c1dee
build(deps): bump sigs.k8s.io/controller-runtime from 0.14.0 to 0.14.1
dependabot[bot] Dec 22, 2022
2891a8c
Merge pull request #841 from kubernetes-csi/dependabot/go_modules/sig…
k8s-ci-robot Dec 22, 2022
118adce
Add changelog for v3.4.0
RaunakShah Dec 16, 2022
831b9c5
Merge pull request #838 from RaunakShah/3.4-release-notes
k8s-ci-robot Dec 27, 2022
90a3226
Merge remote-tracking branch 'openshift/master' into rebase-3.4.0
mpatlasov Jan 30, 2023
32fdfc3
UPSTREAM: <carry>: Add OpenShift files
mpatlasov Jan 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
134 changes: 134 additions & 0 deletions CHANGELOG/CHANGELOG-3.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Release notes for v3.4.0

[Documentation](https://kubernetes-csi.github.io)

# Changelog since v3.3.0

## Changes by Kind

### Feature

- Add support for cross-namespace data sources alpha feature ([#805](https://github.com/kubernetes-csi/external-provisioner/pull/805), [@ttakahashi21]
- Register metrics exposed by sig-storage-lib ([#792](https://github.com/kubernetes-csi/external-provisioner/pull/792), [@RaunakShah](https://github.com/RaunakShah))
- Update the annotation that needs to be applies to VolumeSnapshotContents from snapshot.storage.kubernetes.io/allowVolumeModeChange to snapshot.storage.kubernetes.io/allow-volume-mode-change ([#791](https://github.com/kubernetes-csi/external-provisioner/pull/791), [@RaunakShah](https://github.com/RaunakShah))

### Bug or Regression

- Fix string pointer comparison for source volume mode conversion ([#793](https://github.com/kubernetes-csi/external-provisioner/pull/793), [@RaunakShah](https://github.com/RaunakShah))
- Fix nil pointer crash for PV without ClaimRef ([#796](https://github.com/kubernetes-csi/external-provisioner/pull/796), [@zezaeoh](https://github.com/zezaeoh))

### Uncategorized

- Update go to 1.19 and dependencies for k8s v1.26.0 ([#834](https://github.com/kubernetes-csi/external-provisioner/pull/834), [@sunnylovestiramisu](https://github.com/sunnylovestiramisu))

## Dependencies

### Added
- github.com/ahmetb/gen-crd-api-reference-docs: [v0.3.0](https://github.com/ahmetb/gen-crd-api-reference-docs/tree/v0.3.0)
- github.com/antlr/antlr4/runtime/Go/antlr: [v1.4.10](https://github.com/antlr/antlr4/runtime/Go/antlr/tree/v1.4.10)
- github.com/cenkalti/backoff/v4: [v4.1.3](https://github.com/cenkalti/backoff/v4/tree/v4.1.3)
- github.com/dgrijalva/jwt-go: [v3.2.0+incompatible](https://github.com/dgrijalva/jwt-go/tree/v3.2.0)
- github.com/docker/spdystream: [449fdfc](https://github.com/docker/spdystream/tree/449fdfc)
- github.com/emicklei/go-restful: [ff4f55a](https://github.com/emicklei/go-restful/tree/ff4f55a)
- github.com/fatih/color: [v1.12.0](https://github.com/fatih/color/tree/v1.12.0)
- github.com/go-logr/stdr: [v1.2.2](https://github.com/go-logr/stdr/tree/v1.2.2)
- github.com/go-openapi/spec: [6aced65](https://github.com/go-openapi/spec/tree/6aced65)
- github.com/gobuffalo/flect: [v0.2.3](https://github.com/gobuffalo/flect/tree/v0.2.3)
- github.com/google/cel-go: [v0.12.5](https://github.com/google/cel-go/tree/v0.12.5)
- github.com/googleapis/gnostic: [v0.4.1](https://github.com/googleapis/gnostic/tree/v0.4.1)
- github.com/grpc-ecosystem/grpc-gateway/v2: [v2.7.0](https://github.com/grpc-ecosystem/grpc-gateway/v2/tree/v2.7.0)
- github.com/lithammer/dedent: [v1.1.0](https://github.com/lithammer/dedent/tree/v1.1.0)
- github.com/mattn/go-colorable: [v0.1.8](https://github.com/mattn/go-colorable/tree/v0.1.8)
- github.com/mattn/go-isatty: [v0.0.12](https://github.com/mattn/go-isatty/tree/v0.0.12)
- go.opentelemetry.io/otel/exporters/otlp/internal/retry: v1.10.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc: v1.10.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace: v1.10.0
- k8s.io/klog: v0.2.0
- k8s.io/kms: v0.26.0
- sigs.k8s.io/controller-tools: v0.7.0
- sigs.k8s.io/gateway-api: v0.6.0

### Changed
- github.com/Azure/go-autorest/autorest/adal: [v0.9.20 → v0.8.2](https://github.com/Azure/go-autorest/autorest/adal/compare/v0.9.20...v0.8.2)
- github.com/Azure/go-autorest/autorest/date: [v0.3.0 → v0.2.0](https://github.com/Azure/go-autorest/autorest/date/compare/v0.3.0...v0.2.0)
- github.com/Azure/go-autorest/autorest/mocks: [v0.4.2 → v0.3.0](https://github.com/Azure/go-autorest/autorest/mocks/compare/v0.4.2...v0.3.0)
- github.com/Azure/go-autorest/autorest: [v0.11.27 → v0.9.6](https://github.com/Azure/go-autorest/autorest/compare/v0.11.27...v0.9.6)
- github.com/Azure/go-autorest/logger: [v0.2.1 → v0.1.0](https://github.com/Azure/go-autorest/logger/compare/v0.2.1...v0.1.0)
- github.com/Azure/go-autorest/tracing: [v0.6.0 → v0.5.0](https://github.com/Azure/go-autorest/tracing/compare/v0.6.0...v0.5.0)
- github.com/container-storage-interface/spec: [v1.6.0 → v1.7.0](https://github.com/container-storage-interface/spec/compare/v1.6.0...v1.7.0)
- github.com/cpuguy83/go-md2man/v2: [v2.0.1 → v2.0.2](https://github.com/cpuguy83/go-md2man/v2/compare/v2.0.1...v2.0.2)
- github.com/felixge/httpsnoop: [v1.0.1 → v1.0.3](https://github.com/felixge/httpsnoop/compare/v1.0.1...v1.0.3)
- github.com/fsnotify/fsnotify: [v1.5.4 → v1.6.0](https://github.com/fsnotify/fsnotify/compare/v1.5.4...v1.6.0)
- github.com/google/go-cmp: [v0.5.8 → v0.5.9](https://github.com/google/go-cmp/compare/v0.5.8...v0.5.9)
- github.com/google/martian/v3: [v3.2.1 → v3.0.0](https://github.com/google/martian/v3/compare/v3.2.1...v3.0.0)
- github.com/google/pprof: [4bb14d4 → 94a9f03](https://github.com/google/pprof/compare/4bb14d4...94a9f03)
- github.com/googleapis/gax-go/v2: [v2.1.0 → v2.0.5](https://github.com/googleapis/gax-go/v2/compare/v2.1.0...v2.0.5)
- github.com/inconshreveable/mousetrap: [v1.0.0 → v1.0.1](https://github.com/inconshreveable/mousetrap/compare/v1.0.0...v1.0.1)
- github.com/kubernetes-csi/csi-lib-utils: [v0.11.0 → v0.12.0](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.11.0...v0.12.0)
- github.com/matttproud/golang_protobuf_extensions: [c182aff → v1.0.2](https://github.com/matttproud/golang_protobuf_extensions/compare/c182aff...v1.0.2)
- github.com/moby/term: [3f7ff69 → 39b0c02](https://github.com/moby/term/compare/3f7ff69...39b0c02)
- github.com/onsi/ginkgo/v2: [v2.1.6 → v2.6.0](https://github.com/onsi/ginkgo/v2/compare/v2.1.6...v2.6.0)
- github.com/onsi/ginkgo: [v1.16.5 → v1.16.4](https://github.com/onsi/ginkgo/compare/v1.16.5...v1.16.4)
- github.com/onsi/gomega: [v1.20.1 → v1.24.1](https://github.com/onsi/gomega/compare/v1.20.1...v1.24.1)
- github.com/prometheus/client_golang: [v1.13.0 → v1.14.0](https://github.com/prometheus/client_golang/compare/v1.13.0...v1.14.0)
- github.com/prometheus/client_model: [v0.2.0 → v0.3.0](https://github.com/prometheus/client_model/compare/v0.2.0...v0.3.0)
- github.com/spf13/afero: [v1.6.0 → v1.2.2](https://github.com/spf13/afero/compare/v1.6.0...v1.2.2)
- github.com/spf13/cobra: [v1.4.0 → v1.6.0](https://github.com/spf13/cobra/compare/v1.4.0...v1.6.0)
- github.com/stretchr/objx: [v0.4.0 → v0.5.0](https://github.com/stretchr/objx/compare/v0.4.0...v0.5.0)
- github.com/stretchr/testify: [v1.8.0 → v1.8.1](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)
- go.etcd.io/etcd/api/v3: v3.5.4 → v3.5.5
- go.etcd.io/etcd/client/pkg/v3: v3.5.4 → v3.5.5
- go.etcd.io/etcd/client/v2: v2.305.4 → v2.305.5
- go.etcd.io/etcd/client/v3: v3.5.4 → v3.5.5
- go.etcd.io/etcd/pkg/v3: v3.5.4 → v3.5.5
- go.etcd.io/etcd/raft/v3: v3.5.4 → v3.5.5
- go.etcd.io/etcd/server/v3: v3.5.4 → v3.5.5
- go.opencensus.io: v0.23.0 → v0.22.4
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc: v0.20.0 → v0.35.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp: v0.20.0 → v0.35.0
- go.opentelemetry.io/otel/metric: v0.20.0 → v0.31.0
- go.opentelemetry.io/otel/sdk: v0.20.0 → v1.10.0
- go.opentelemetry.io/otel/trace: v0.20.0 → v1.10.0
- go.opentelemetry.io/otel: v0.20.0 → v1.10.0
- go.opentelemetry.io/proto/otlp: v0.7.0 → v0.19.0
- go.uber.org/goleak: v1.1.12 → v1.2.0
- go.uber.org/zap: v1.21.0 → v1.24.0
- golang.org/x/crypto: 3147a52 → v0.1.0
- golang.org/x/lint: 6edffad → 738671d
- golang.org/x/mod: 86c51ed → v0.6.0
- golang.org/x/net: bea034e → v0.4.0
- golang.org/x/sys: fb04ddd → v0.3.0
- golang.org/x/term: 03fcf44 → v0.3.0
- golang.org/x/text: v0.3.7 → v0.5.0
- golang.org/x/time: 579cf78 → v0.3.0
- golang.org/x/tools: v0.1.12 → v0.2.0
- google.golang.org/api: v0.57.0 → v0.30.0
- google.golang.org/grpc: v1.49.0 → v1.51.0
- k8s.io/api: v0.25.2 → v0.26.0
- k8s.io/apiextensions-apiserver: v0.25.2 → v0.26.0
- k8s.io/apimachinery: v0.25.2 → v0.26.0
- k8s.io/apiserver: v0.25.2 → v0.26.0
- k8s.io/client-go: v0.25.2 → v0.26.0
- k8s.io/code-generator: v0.25.2 → v0.26.0
- k8s.io/component-base: v0.25.2 → v0.26.0
- k8s.io/component-helpers: v0.25.2 → v0.26.0
- k8s.io/csi-translation-lib: v0.25.2 → v0.26.0
- k8s.io/kube-openapi: a70c9af → 172d655
- k8s.io/utils: ee6ede2 → 99ec85e
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client: v0.0.32 → v0.0.33
- sigs.k8s.io/controller-runtime: v0.13.0 → v0.14.1

### Removed
- github.com/Azure/go-autorest: [v14.2.0+incompatible](https://github.com/Azure/go-autorest/tree/v14.2.0)
- github.com/benbjohnson/clock: [v1.1.0](https://github.com/benbjohnson/clock/tree/v1.1.0)
- github.com/creack/pty: [v1.1.11](https://github.com/creack/pty/tree/v1.1.11)
- github.com/getkin/kin-openapi: [v0.76.0](https://github.com/getkin/kin-openapi/tree/v0.76.0)
- github.com/golang-jwt/jwt/v4: [v4.2.0](https://github.com/golang-jwt/jwt/v4/tree/v4.2.0)
- github.com/golang/snappy: [v0.0.3](https://github.com/golang/snappy/tree/v0.0.3)
- github.com/gorilla/mux: [v1.8.0](https://github.com/gorilla/mux/tree/v1.8.0)
- go.opentelemetry.io/contrib: v0.20.0
- go.opentelemetry.io/otel/exporters/otlp: v0.20.0
- go.opentelemetry.io/otel/oteltest: v0.20.0
- go.opentelemetry.io/otel/sdk/export/metric: v0.20.0
- go.opentelemetry.io/otel/sdk/metric: v0.20.0
- google.golang.org/grpc/cmd/protoc-gen-go-grpc: v1.1.0
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This information reflects the head of this branch.

| Compatible with CSI Version | Container Image | [Min K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#minimum-version) | [Recommended K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#recommended-version) |
| ------------------------------------------------------------------------------------------ | -------------------------------| --------------- | ------------- |
| [CSI Spec v1.6.0](https://github.com/container-storage-interface/spec/releases/tag/v1.6.0) | k8s.gcr.io/sig-storage/csi-provisioner | 1.20 | 1.25 |
| [CSI Spec v1.7.0](https://github.com/container-storage-interface/spec/releases/tag/v1.7.0) | k8s.gcr.io/sig-storage/csi-provisioner | 1.20 | 1.26 |

## Feature status

Expand All @@ -27,7 +27,8 @@ Following table reflects the head of this branch.
| ReadWriteOncePod | Alpha | Off | [Single pod access mode for PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). | No |
| HonorPVReclaimPolicy| Alpha |Off | [Honor the PV reclaim policy](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2644-honor-pv-reclaim-policy) | No |
| PreventVolumeModeConversion | Alpha |Off | [Prevent unauthorized conversion of source volume mode](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3141-prevent-volume-mode-conversion) | `--prevent-volume-mode-conversion` (No in-tree feature gate) |
| CSINodeExpandSecret | Alpha |Off | [CSI Node expansion secret](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3107-csi-nodeexpandsecret) | No
| CSINodeExpandSecret | Alpha |Off | [CSI Node expansion secret](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3107-csi-nodeexpandsecret) | No |
| CrossNamespaceVolumeDataSource | Alpha |Off | [Cross-namespace volume data source](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/3294-provision-volumes-from-cross-namespace-snapshots) | `--feature-gates=CrossNamespaceVolumeDataSource=true` |

All other external-provisioner features and the external-provisioner itself is considered GA and fully supported.

Expand Down
42 changes: 42 additions & 0 deletions cmd/csi-provisioner/csi-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
csitrans "k8s.io/csi-translation-lib"
"k8s.io/klog/v2"
"sigs.k8s.io/sig-storage-lib-external-provisioner/v8/controller"
libmetrics "sigs.k8s.io/sig-storage-lib-external-provisioner/v8/controller/metrics"

"github.com/kubernetes-csi/csi-lib-utils/leaderelection"
"github.com/kubernetes-csi/csi-lib-utils/metrics"
Expand All @@ -63,6 +64,9 @@ import (
"github.com/kubernetes-csi/external-provisioner/pkg/features"
"github.com/kubernetes-csi/external-provisioner/pkg/owner"
snapclientset "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned"
gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
gatewayInformers "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions"
referenceGrantv1beta1 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1"
)

var (
Expand Down Expand Up @@ -191,6 +195,15 @@ func main() {
klog.Fatalf("Failed to create snapshot client: %v", err)
}

var gatewayClient gatewayclientset.Interface
if utilfeature.DefaultFeatureGate.Enabled(features.CrossNamespaceVolumeDataSource) {
// gatewayclientset.NewForConfig creates a new Clientset for GatewayClient
gatewayClient, err = gatewayclientset.NewForConfig(config)
if err != nil {
klog.Fatalf("Failed to create gateway client: %v", err)
}
}

metricsManager := metrics.NewCSIMetricsManagerWithOptions("", /* driverName */
// Will be provided via default gatherer.
metrics.WithProcessStartTime(false),
Expand Down Expand Up @@ -353,6 +366,14 @@ func main() {
}
}

var referenceGrantLister referenceGrantv1beta1.ReferenceGrantLister
var gatewayFactory gatewayInformers.SharedInformerFactory
if utilfeature.DefaultFeatureGate.Enabled(features.CrossNamespaceVolumeDataSource) {
gatewayFactory = gatewayInformers.NewSharedInformerFactory(gatewayClient, ctrl.ResyncPeriodOfReferenceGrantInformer)
referenceGrants := gatewayFactory.Gateway().V1beta1().ReferenceGrants()
referenceGrantLister = referenceGrants.Lister()
}

// -------------------------------
// PersistentVolumeClaims informer
rateLimiter := workqueue.NewItemExponentialFailureRateLimiter(*retryIntervalStart, *retryIntervalMax)
Expand Down Expand Up @@ -401,6 +422,7 @@ func main() {
nodeLister,
claimLister,
vaLister,
referenceGrantLister,
*extraCreateMetadata,
*defaultFSType,
nodeDeployment,
Expand Down Expand Up @@ -551,6 +573,14 @@ func main() {
// To collect metrics data from the metric handler itself, we
// let it register itself and then collect from that registry.
reg := prometheus.NewRegistry()
reg.MustRegister([]prometheus.Collector{
libmetrics.PersistentVolumeClaimProvisionTotal,
libmetrics.PersistentVolumeClaimProvisionFailedTotal,
libmetrics.PersistentVolumeClaimProvisionDurationSeconds,
libmetrics.PersistentVolumeDeleteTotal,
libmetrics.PersistentVolumeDeleteFailedTotal,
libmetrics.PersistentVolumeDeleteDurationSeconds,
}...)
gatherers = append(gatherers, reg)

// This is similar to k8s.io/component-base/metrics HandlerWithReset
Expand Down Expand Up @@ -595,6 +625,18 @@ func main() {
}
}

if utilfeature.DefaultFeatureGate.Enabled(features.CrossNamespaceVolumeDataSource) {
if gatewayFactory != nil {
gatewayFactory.Start(ctx.Done())
}
gatewayCacheSyncResult := gatewayFactory.WaitForCacheSync(ctx.Done())
for _, v := range gatewayCacheSyncResult {
if !v {
klog.Fatalf("Failed to sync Informers for gateway!")
}
}
}

if capacityController != nil {
go capacityController.Run(ctx, int(*capacityThreads))
}
Expand Down
7 changes: 7 additions & 0 deletions deploy/kubernetes/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch"]
# (Alpha) Access to referencegrants is only needed when the CSI driver
# has the CrossNamespaceVolumeDataSource controller capability.
# In that case, external-provisioner requires "get", "list", "watch"
# permissions for "referencegrants" on "gateway.networking.k8s.io".
#- apiGroups: ["gateway.networking.k8s.io"]
# resources: ["referencegrants"]
# verbs: ["get", "list", "watch"]

---
kind: ClusterRoleBinding
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/storage-capacity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
serviceAccount: csi-provisioner
containers:
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.1.0
image: registry.k8s.io/sig-storage/csi-provisioner:v3.3.0
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election"
Expand Down
Loading