-
Notifications
You must be signed in to change notification settings - Fork 586
STOR-2859: Add APIs for disabling force detach in KCM operator #2668
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
Open
dobsonj
wants to merge
1
commit into
openshift:master
Choose a base branch
from
dobsonj:STOR-2859
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+659
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
config/v1/tests/controllermanagers.config.openshift.io/AAA_ungated.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this | ||
| name: "ControllerManager" | ||
| crdName: controllermanagers.config.openshift.io | ||
| tests: | ||
| onCreate: | ||
| - name: Should be able to create with default values | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Enabled | ||
| - name: Should be able to create with force detach enabled | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Enabled | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Enabled | ||
| - name: Should be able to create with force detach disabled | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Disabled | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Disabled | ||
| - name: Should reject unsupported value of forceDetachOnTimeout | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: INVALID | ||
| expectedError: "spec.forceDetachOnTimeout: Unsupported value: \"INVALID\": supported values: \"Enabled\", \"Disabled\"" | ||
| onUpdate: | ||
| - name: Enabled to Disabled | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Enabled | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Disabled | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Disabled | ||
| - name: Disabled to default value | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Disabled | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: ControllerManager | ||
| spec: | ||
| forceDetachOnTimeout: Enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| package v1 | ||
|
|
||
| import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
|
||
| // +genclient | ||
| // +genclient:nonNamespaced | ||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // ControllerManager holds cluster-wide config information to run the Kubernetes controller manager | ||
| // and influence its placement decisions. The canonical name for this config is `cluster`. | ||
| // | ||
| // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). | ||
| // +openshift:compatibility-gen:level=1 | ||
| // +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2668 | ||
| // +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:resource:path=controllermanagers,scope=Cluster | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:metadata:annotations=release.openshift.io/bootstrap-required=true | ||
| type ControllerManager struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
|
|
||
| // metadata is the standard object's metadata. | ||
| // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | ||
| // +optional | ||
| metav1.ObjectMeta `json:"metadata,omitzero"` | ||
| // spec holds user settable values for configuration | ||
| // +required | ||
| Spec ControllerManagerSpec `json:"spec,omitzero"` | ||
| // status holds observed values from the cluster. They may not be overridden. | ||
| // +optional | ||
| Status ControllerManagerStatus `json:"status,omitzero"` | ||
| } | ||
|
|
||
| // ControllerManagerSpec defines the desired state of the Kubernetes controller manager | ||
| // +kubebuilder:validation:MinProperties=1 | ||
| type ControllerManagerSpec struct { | ||
| // forceDetachOnTimeout expresses whether to allow kube-controller-manager | ||
| // to force detach volumes when unmount takes longer than the timeout. | ||
| // Valid values are Enabled and Disabled. If omitted, the default is Enabled. | ||
| // +default="Enabled" | ||
| // +optional | ||
| ForceDetachOnTimeout ForceDetachOnTimeoutPolicy `json:"forceDetachOnTimeout,omitempty"` | ||
| } | ||
|
|
||
| // +kubebuilder:validation:Enum=Enabled;Disabled | ||
| type ForceDetachOnTimeoutPolicy string | ||
|
|
||
| const ( | ||
| // ForceDetachOnTimeoutEnabled will allow kube-controller-manager to | ||
| // force detach volumes based on maximum unmount time and node status. | ||
| ForceDetachOnTimeoutEnabled ForceDetachOnTimeoutPolicy = "Enabled" | ||
| // ForceDetachOnTimeoutDisabled will prevent kube-controller-manager | ||
| // from force detaching volumes. | ||
| ForceDetachOnTimeoutDisabled ForceDetachOnTimeoutPolicy = "Disabled" | ||
| ) | ||
|
|
||
| // ControllerManagerStatus defines the observed state of the Kubernetes controller manager | ||
| // +kubebuilder:validation:MinProperties=1 | ||
| type ControllerManagerStatus struct { | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
|
||
| // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). | ||
| // +openshift:compatibility-gen:level=1 | ||
| type ControllerManagerList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
|
|
||
| // metadata is the standard list's metadata. | ||
| // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | ||
| metav1.ListMeta `json:"metadata"` | ||
|
|
||
| Items []ControllerManager `json:"items"` | ||
| } | ||
72 changes: 72 additions & 0 deletions
72
config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_controllermanagers.crd.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| api-approved.openshift.io: https://github.com/openshift/api/pull/2668 | ||
| api.openshift.io/merged-by-featuregates: "true" | ||
| include.release.openshift.io/ibm-cloud-managed: "true" | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| release.openshift.io/bootstrap-required: "true" | ||
| name: controllermanagers.config.openshift.io | ||
| spec: | ||
| group: config.openshift.io | ||
| names: | ||
| kind: ControllerManager | ||
| listKind: ControllerManagerList | ||
| plural: controllermanagers | ||
| singular: controllermanager | ||
| scope: Cluster | ||
| versions: | ||
| - name: v1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: |- | ||
| ControllerManager holds cluster-wide config information to run the Kubernetes controller manager | ||
| and influence its placement decisions. The canonical name for this config is `cluster`. | ||
|
|
||
| Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). | ||
| properties: | ||
| apiVersion: | ||
| description: |- | ||
| APIVersion defines the versioned schema of this representation of an object. | ||
| Servers should convert recognized schemas to the latest internal value, and | ||
| may reject unrecognized values. | ||
| More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
| type: string | ||
| kind: | ||
| description: |- | ||
| Kind is a string value representing the REST resource this object represents. | ||
| Servers may infer this from the endpoint the client submits requests to. | ||
| Cannot be updated. | ||
| In CamelCase. | ||
| More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: spec holds user settable values for configuration | ||
| minProperties: 1 | ||
| properties: | ||
| forceDetachOnTimeout: | ||
| default: Enabled | ||
| description: |- | ||
| forceDetachOnTimeout expresses whether to allow kube-controller-manager | ||
| to force detach volumes when unmount takes longer than the timeout. | ||
| Valid values are Enabled and Disabled. If omitted, the default is Enabled. | ||
| enum: | ||
| - Enabled | ||
| - Disabled | ||
| type: string | ||
| type: object | ||
| status: | ||
| description: status holds observed values from the cluster. They may not | ||
| be overridden. | ||
| minProperties: 1 | ||
| type: object | ||
| required: | ||
| - spec | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.