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

Add CSI_REMOVE_HOLDER_PODS key and its value in the ocs configmap #2513

Merged
merged 1 commit into from
Mar 19, 2024
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
16 changes: 15 additions & 1 deletion controllers/ocsinitialization/ocsinitialization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,23 @@ func (r *OCSInitializationReconciler) ensureOcsOperatorConfigExists(initialData
Name: util.OcsOperatorConfigName,
Namespace: initialData.Namespace,
},
Data: ocsOperatorConfigData,
iamniting marked this conversation as resolved.
Show resolved Hide resolved
}
opResult, err := ctrl.CreateOrUpdate(r.ctx, r.Client, ocsOperatorConfig, func() error {

// If the configmap is being created for the first time, set the entry for
// CSI_REMOVE_HOLDER_PODS to "true". This configuration is applied for new clusters
// starting from ODF version 4.16 onwards. For old or upgraded clusters,
// it's initially set to "false", allowing users time to manually migrate from holder pods.
// In ODF version 4.17, we will universally set it to "true" for all users.

if ocsOperatorConfig.CreationTimestamp.IsZero() {
ocsOperatorConfigData[util.CsiRemoveHolderPodsKey] = "true"
} else if ocsOperatorConfig.Data[util.CsiRemoveHolderPodsKey] == "" {
ocsOperatorConfigData[util.CsiRemoveHolderPodsKey] = "false"
} else if ocsOperatorConfig.Data[util.CsiRemoveHolderPodsKey] != "" {
ocsOperatorConfigData[util.CsiRemoveHolderPodsKey] = ocsOperatorConfig.Data[util.CsiRemoveHolderPodsKey]
iamniting marked this conversation as resolved.
Show resolved Hide resolved
}

if !reflect.DeepEqual(ocsOperatorConfig.Data, ocsOperatorConfigData) {
r.Log.Info("Updating ocs-operator-config configmap")
ocsOperatorConfig.Data = ocsOperatorConfigData
Expand Down
1 change: 1 addition & 0 deletions controllers/util/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
EnableTopologyKey = "CSI_ENABLE_TOPOLOGY"
TopologyDomainLabelsKey = "CSI_TOPOLOGY_DOMAIN_LABELS"
EnableNFSKey = "ROOK_CSI_ENABLE_NFS"
CsiRemoveHolderPodsKey = "CSI_REMOVE_HOLDER_PODS"
)

// GetWatchNamespace returns the namespace the operator should be watching for changes
Expand Down
Loading