Skip to content

Commit

Permalink
add disableCsiLvm feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
ostempel committed Nov 25, 2024
1 parent bfa57a2 commit 82be527
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ check: $(GOIMPORTS) $(GOLANGCI_LINT) $(HELM)

.PHONY: generate
generate: $(VGOPATH) $(HELM) $(YQ)
echo $(shell git -c safe.directory=/go/src/github.com/metal-stack/gardener-extension-provider-metal describe --abbrev=0 --tags) > VERSION
@REPO_ROOT=$(REPO_ROOT) VGOPATH=$(VGOPATH) GARDENER_HACK_DIR=$(GARDENER_HACK_DIR) bash $(GARDENER_HACK_DIR)/generate-sequential.sh ./charts/... ./cmd/... ./pkg/...

.PHONY: generate-in-docker
generate-in-docker: tidy update-crds $(HELM)
echo $(shell git describe --abbrev=0 --tags) > VERSION
generate-in-docker: tidy install update-crds$(HELM)
docker run --rm -i$(DOCKER_TTY_ARG) \
--volume $(PWD):/go/src/github.com/metal-stack/gardener-extension-provider-metal golang:$(GO_VERSION) \
sh -c "cd /go/src/github.com/metal-stack/gardener-extension-provider-metal \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if not .Values.disableCsiLvm }}
---
apiVersion: v1
kind: Namespace
Expand Down Expand Up @@ -255,3 +256,4 @@ spec:
path: /run/lock/lvm
type: DirectoryOrCreate
name: lvmlock
{{ end }}
5 changes: 3 additions & 2 deletions charts/internal/shoot-storageclasses/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
images:
csi-lvm-controller: image-repository:image-tag
csi-lvm-provisioner: image-repository:image-tag
csi-lvm-controller: image-repository:image-tag
csi-lvm-provisioner: image-repository:image-tag

isDefaultStorageClass: true
disableCsiLvm: false
5 changes: 5 additions & 0 deletions pkg/apis/metal/types_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ type ControlPlaneFeatures struct {
// Deprecated: This is not used anymore. The gardener-extension-audit handles cluster auditing.
// +optional
AuditToSplunk *bool

// DisableCsiLvm disables the deployment of the csi-lvm driver for the control plane.
// In order to deploy the new csi-driver-lvm, the feature gate must be enabled so the old driver is removed.
// +optional
DisableCsiLvm *bool `json:"disableCsiLvm,omitempty"`
}

// CloudControllerManagerConfig contains configuration settings for the cloud-controller-manager.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/metal/v1alpha1/types_controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ type ControlPlaneFeatures struct {
// Deprecated: This is not used anymore. The gardener-extension-audit handles cluster auditing.
// +optional
AuditToSplunk *bool `json:"auditToSplunk,omitempty"`

// DisableCsiLvm disables the deployment of the csi-lvm driver for the control plane.
// In order to deploy the new csi-driver-lvm, the feature gate must be enabled so the old driver is removed.
// +optional
DisableCsiLvm *bool `json:"disableCsiLvm,omitempty"`
}

// CloudControllerManagerConfig contains configuration settings for the cloud-controller-manager.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/metal/v1alpha1/zz_generated.conversion.go

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

5 changes: 5 additions & 0 deletions pkg/apis/metal/v1alpha1/zz_generated.deepcopy.go

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

5 changes: 5 additions & 0 deletions pkg/apis/metal/zz_generated.deepcopy.go

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

6 changes: 6 additions & 0 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,14 @@ func (vp *valuesProvider) GetStorageClassesChartValues(_ context.Context, contro
isDefaultSC = false
}

disableCsiLvm := false
if cp.FeatureGates.DisableCsiLvm != nil {
disableCsiLvm = *cp.FeatureGates.DisableCsiLvm
}

values := map[string]interface{}{
"isDefaultStorageClass": isDefaultSC,
"disableCsiLvm": disableCsiLvm,
}

return values, nil
Expand Down

0 comments on commit 82be527

Please sign in to comment.