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 <[email protected]>
  • Loading branch information
iamniting committed Mar 8, 2024
1 parent eb9bab0 commit bfcc85d
Show file tree
Hide file tree
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
Expand Up @@ -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 in the configmap via controller
CsiPluginTolerationsModified bool `json:"csiPluginTolerationsModified,omitempty"`
// CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations are added in the configmap via controller
CsiProvisionerTolerationsModified bool `json:"csiProvisionerTolerationsModified,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
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
Expand Up @@ -196,6 +196,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added in the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added in the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added in the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added in the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:
Expand Down
11 changes: 11 additions & 0 deletions deploy/ocs-operator/manifests/ocsinitialization.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
rookCephOperatorConfig:
properties:
csiPluginTolerationsModified:
description: CsiPluginTolerationsModified indicates if CsiPluginTolerations
are added in the configmap via controller
type: boolean
csiProvisionerTolerationsModified:
description: CsiProvisionerTolerationsModified indicates if CsiProvisionerTolerations
are added in the configmap via controller
type: boolean
type: object
rookCephOperatorConfigCreated:
type: boolean
sCCsCreated:
Expand Down

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 bfcc85d

Please sign in to comment.