Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions assets/components/csi-snapshot-controller/webhook_clusterrole.yaml

This file was deleted.

This file was deleted.

42 changes: 0 additions & 42 deletions assets/components/csi-snapshot-controller/webhook_config.yaml

This file was deleted.

83 changes: 0 additions & 83 deletions assets/components/csi-snapshot-controller/webhook_deployment.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions assets/components/csi-snapshot-controller/webhook_service.yaml

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions assets/release/release-aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"pod": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:618a701c092403624182c4969c1a6a2f4aadd26c7b50e46c7fbe7175da0f3575",
"service-ca-operator": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:ddbe4e12785990a4764abb85ef5c5c64bdaafa83c29e35beb77e03d995f0b256",
"lvms_operator": "registry.redhat.io/lvms4/lvms-rhel9-operator@sha256:bd6dc4d6e90fdbcdb844759e203c9c591abc5ac29a956257a90bda101a37b76e",
"csi-snapshot-controller": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:b7c79ee759c3bb9ae50d27d7487c9dc9de5224c9175ac9636f500ab0fd46e90b",
"csi-snapshot-validation-webhook": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:30ca243687727c62df5c0f952105a52c6e587c1ec0f348ae91bf8e09de7f2494"
"csi-snapshot-controller": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:b7c79ee759c3bb9ae50d27d7487c9dc9de5224c9175ac9636f500ab0fd46e90b"
}
}
3 changes: 1 addition & 2 deletions assets/release/release-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"pod": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:9baab801b7c1371ecebdbb4570228756e056689e7f834fbfc597df4c8eb1e3fd",
"service-ca-operator": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:e91a5da769452f47bb5c2518174474b08d466344cd9a46f49d386f0562e88acd",
"lvms_operator": "registry.redhat.io/lvms4/lvms-rhel9-operator@sha256:bd6dc4d6e90fdbcdb844759e203c9c591abc5ac29a956257a90bda101a37b76e",
"csi-snapshot-controller": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:d49a8e92e26b4e27adbb1d37cf15a2ea2ae0501054ff9db1a355c80802fdc9ba",
"csi-snapshot-validation-webhook": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:41c28bd33107bba44960076491be57572c782b1275ae5519b0bcd04853efbdb8"
"csi-snapshot-controller": "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:d49a8e92e26b4e27adbb1d37cf15a2ea2ae0501054ff9db1a355c80802fdc9ba"
}
}
6 changes: 2 additions & 4 deletions cmd/generate-config/config/config-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,21 +434,19 @@
]
},
"optionalCsiComponents": {
"description": "OptionalCSIComponents is a user defined slice of CSIComponent values. These value tell MicroShift which\nadditional, non-driver, CSI controllers to deploy on start. MicroShift will deploy snapshot controller\nand webhook when no components are specified. This preserves the current deployment behavior of existing\nclusters. Users must set `.storage.optionalCsiComponents: []` to explicitly tell MicroShift not to deploy any CSI\ncomponents. The CSI Driver is excluded as it is typically deployed via the same manifest as the accompanying\nstorage driver. Like CSIStorageDriver, uninstallation is not supported as this can lead to orphaned storage\nobjects.\nAllowed values are: unset, [], or one or more of [\"snapshot-controller\", \"snapshot-webhook\"]",
"description": "OptionalCSIComponents is a user defined slice of CSIComponent values. These value tell MicroShift which\nadditional, non-driver, CSI controllers to deploy on start. MicroShift will deploy snapshot controller\nwhen no components are specified. This preserves the current deployment behavior of existing\nclusters. Users must set `.storage.optionalCsiComponents: []` to explicitly tell MicroShift not to deploy any CSI\ncomponents. The CSI Driver is excluded as it is typically deployed via the same manifest as the accompanying\nstorage driver. Like CSIStorageDriver, uninstallation is not supported as this can lead to orphaned storage\nobjects.\nAllowed values are: unset, [], or one or more of [\"snapshot-controller\"]",
"type": "array",
"items": {
"description": "OptionalCsiComponent values determine which CSI components MicroShift should deploy. Currently only csi snapshot components\nare supported.",
"type": "string",
"enum": [
"none",
"snapshot-controller",
"snapshot-webhook",
""
]
},
"example": [
"snapshot-controller",
"snapshot-webhook"
"snapshot-controller"
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/user/howto_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ specifying supported values under `.storage` node of the MicroShift config in th
storage
optionalCsiComponents: **ARRAY**.
```
- Expected values are: `['csi-snapshot-controller', 'csi-snapshot-webhook', 'none']`. `'none'` is mutually exclusive
- Expected values are: `['csi-snapshot-controller', 'none']`. `'none'` is mutually exclusive
with all other values.
- Empty array defaults to deploying `snapshot-controller` and `snapshot-webhook`.
- Empty array defaults to deploying `snapshot-controller`.

### Automated Uninstallation is Not Supported

Expand Down

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

1 change: 0 additions & 1 deletion okd/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
> oc get pods
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system csi-snapshot-controller-7d6c78bc58-5p7tb 1/1 Running 0 8m52s
kube-system csi-snapshot-webhook-5598db6db4-rmrpx 1/1 Running 0 8m54s
openshift-dns dns-default-2q89q 2/2 Running 0 7m34s
openshift-dns node-resolver-k2c5h 1/1 Running 0 8m54s
openshift-ingress router-default-db4b598b9-x8lvb 1/1 Running 0 8m52s
Expand Down
5 changes: 2 additions & 3 deletions packaging/microshift/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,14 @@ storage:
driver: ""
# OptionalCSIComponents is a user defined slice of CSIComponent values. These value tell MicroShift which
# additional, non-driver, CSI controllers to deploy on start. MicroShift will deploy snapshot controller
# and webhook when no components are specified. This preserves the current deployment behavior of existing
# when no components are specified. This preserves the current deployment behavior of existing
# clusters. Users must set `.storage.optionalCsiComponents: []` to explicitly tell MicroShift not to deploy any CSI
# components. The CSI Driver is excluded as it is typically deployed via the same manifest as the accompanying
# storage driver. Like CSIStorageDriver, uninstallation is not supported as this can lead to orphaned storage
# objects.
# Allowed values are: unset, [], or one or more of ["snapshot-controller", "snapshot-webhook"]
# Allowed values are: unset, [], or one or more of ["snapshot-controller"]
# example:
# - snapshot-controller
# - snapshot-webhook
optionalCsiComponents:
- ""

38 changes: 7 additions & 31 deletions pkg/components/csi-snapshot-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func startCSISnapshotController(ctx context.Context, cfg *config.Config, kubecon
if len(cfg.Storage.OptionalCSIComponents) == 0 {
// Upgraded clusters will not have set .storage.*, so we need to support the prior default behavior and deploy
// CSI snapshots when .storage.optionalCsiComponents is nil.
csiComps.Insert(config.CsiComponentSnapshot, config.CsiComponentSnapshotWebhook)
csiComps.Insert(config.CsiComponentSnapshot)
} else if csiComps.Has(config.CsiComponentNone) {
// User set a zero-len slice, indicating that the cluster supports optional CSI components, and that they should
// be disabled.
Expand All @@ -25,36 +25,12 @@ func startCSISnapshotController(ctx context.Context, cfg *config.Config, kubecon
}

var (
whSA = []string{"components/csi-snapshot-controller/webhook_serviceaccount.yaml"}
whCfg = []string{"components/csi-snapshot-controller/webhook_config.yaml"}
whDeploy = []string{"components/csi-snapshot-controller/webhook_deployment.yaml"}
whSvc = []string{"components/csi-snapshot-controller/webhook_service.yaml"}
cr = []string{"components/csi-snapshot-controller/clusterrole.yaml"}
crb = []string{"components/csi-snapshot-controller/clusterrolebinding.yaml"}
sa = []string{"components/csi-snapshot-controller/serviceaccount.yaml"}
deploy = []string{"components/csi-snapshot-controller/csi_controller_deployment.yaml"}
cr = []string{"components/csi-snapshot-controller/clusterrole.yaml"}
crb = []string{"components/csi-snapshot-controller/clusterrolebinding.yaml"}
sa = []string{"components/csi-snapshot-controller/serviceaccount.yaml"}
deploy = []string{"components/csi-snapshot-controller/csi_controller_deployment.yaml"}
)

// Deploy Webhook
//nolint:nestif
if csiComps.Has(config.CsiComponentSnapshotWebhook) {
klog.Infof("deploying CSI snapshot webhook")
if err := assets.ApplyServiceAccounts(ctx, whSA, kubeconfigPath); err != nil {
return fmt.Errorf("apply service account: %w", err)
}
if err := assets.ApplyDeployments(ctx, whDeploy, renderTemplate, renderParamsFromConfig(cfg, nil), kubeconfigPath); err != nil {
return fmt.Errorf("apply deployment: %w", err)
}
if err := assets.ApplyValidatingWebhookConfiguration(ctx, whCfg, kubeconfigPath); err != nil {
return fmt.Errorf("apply validationWebhookConfiguration: %w", err)
}
if err := assets.ApplyDeployments(ctx, deploy, renderTemplate, renderParamsFromConfig(cfg, nil), kubeconfigPath); err != nil {
return fmt.Errorf("apply deployments: %w", err)
}
} else {
klog.Warningf("CSI snapshot webhook is disabled")
}

// Deploy CSI Controller Deployment
//nolint:nestif
if csiComps.Has(config.CsiComponentSnapshot) || csiComps.Len() == 0 {
Expand All @@ -68,8 +44,8 @@ func startCSISnapshotController(ctx context.Context, cfg *config.Config, kubecon
if err := assets.ApplyServiceAccounts(ctx, sa, kubeconfigPath); err != nil {
return fmt.Errorf("apply service account: %w", err)
}
if err := assets.ApplyServices(ctx, whSvc, nil, map[string]interface{}{}, kubeconfigPath); err != nil {
return fmt.Errorf("apply service: %w", err)
if err := assets.ApplyDeployments(ctx, deploy, renderTemplate, renderParamsFromConfig(cfg, nil), kubeconfigPath); err != nil {
return fmt.Errorf("apply deployments: %w", err)
}
} else {
klog.Warningf("CSI snapshot controller is disabled")
Expand Down
3 changes: 1 addition & 2 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,12 @@ func TestGetActiveConfigFromYAML(t *testing.T) {
driver: "none"
optionalCsiComponents:
- "snapshot-controller"
- "snapshot-webhook"
`),
expected: func() *Config {
c := mkDefaultConfig()
c.Storage = Storage{
Driver: CsiDriverNone,
OptionalCSIComponents: []OptionalCsiComponent{CsiComponentSnapshot, CsiComponentSnapshotWebhook},
OptionalCSIComponents: []OptionalCsiComponent{CsiComponentSnapshot},
}
return c
}(),
Expand Down
Loading