Skip to content

Commit

Permalink
Add status field to track toleration modifications
Browse files Browse the repository at this point in the history
Introduce a new status field to track addition of tolerations in the
rook-ceph-operator-config configmap. The added field status indicates
whether tolerations were successfully added to the configmap. This
information is crucial for ensuring safe deletion, as we will only
proceed with deletion if the tolerations were added by our mechanism.
If they were added by user we will not proceed with the deletion.

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
iamniting committed Mar 18, 2024
1 parent 630fdd6 commit 83168dd
Showing 7 changed files with 89 additions and 8 deletions.
16 changes: 12 additions & 4 deletions api/v1/ocsinitialization_types.go
Original file line number Diff line number Diff line change
@@ -54,10 +54,18 @@ type OCSInitializationStatus struct {
// operator. Object references will be added to this list after they have
// been created AND found in the cluster.
// +optional
RelatedObjects []corev1.ObjectReference `json:"relatedObjects,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
SCCsCreated bool `json:"sCCsCreated,omitempty"`
RookCephOperatorConfigCreated bool `json:"rookCephOperatorConfigCreated,omitempty"`
RelatedObjects []corev1.ObjectReference `json:"relatedObjects,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
SCCsCreated bool `json:"sCCsCreated,omitempty"`
RookCephOperatorConfigCreated bool `json:"rookCephOperatorConfigCreated,omitempty"`
RookCephOperatorConfig RookCephOperatorConfigStatus `json:"rookCephOperatorConfig,omitempty"`
}

type RookCephOperatorConfigStatus struct {
// CsiPluginTolerationsModified indicates if CsiPluginTolerations are added to the configmap via controller
CsiPluginTolerationsModified bool `json:"csiPluginTolerationsModified,omitempty"`
// CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations are added to the configmap via controller
CsiProvisionerTolerationsModified bool `json:"csiProvisionerTolerationsModified,omitempty"`
}

// +kubebuilder:object:root=true
16 changes: 16 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions config/crd/bases/ocs.openshift.io_ocsinitializations.yaml
Original file line number Diff line number Diff line change
@@ -196,6 +196,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added to the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added to the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:
Original file line number Diff line number Diff line change
@@ -196,6 +196,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added to the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added to the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:
11 changes: 11 additions & 0 deletions deploy/ocs-operator/manifests/ocsinitialization.crd.yaml
Original file line number Diff line number Diff line change
@@ -195,6 +195,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added to the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added to the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:

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

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

0 comments on commit 83168dd

Please sign in to comment.