|
| 1 | +package v1 |
| 2 | + |
| 3 | +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 4 | + |
| 5 | +// +genclient |
| 6 | +// +genclient:nonNamespaced |
| 7 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 8 | + |
| 9 | +// ControllerManager holds cluster-wide config information to run the Kubernetes controller manager |
| 10 | +// and influence its placement decisions. The canonical name for this config is `cluster`. |
| 11 | +// |
| 12 | +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). |
| 13 | +// +openshift:compatibility-gen:level=1 |
| 14 | +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2668 |
| 15 | +// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 |
| 16 | +// +kubebuilder:object:root=true |
| 17 | +// +kubebuilder:resource:path=controllermanagers,scope=Cluster |
| 18 | +// +kubebuilder:subresource:status |
| 19 | +// +kubebuilder:metadata:annotations=release.openshift.io/bootstrap-required=true |
| 20 | +type ControllerManager struct { |
| 21 | + metav1.TypeMeta `json:",inline"` |
| 22 | + |
| 23 | + // metadata is the standard object's metadata. |
| 24 | + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 25 | + // +optional |
| 26 | + metav1.ObjectMeta `json:"metadata,omitzero"` |
| 27 | + // spec holds user settable values for configuration |
| 28 | + // +required |
| 29 | + Spec ControllerManagerSpec `json:"spec,omitzero"` |
| 30 | + // status holds observed values from the cluster. They may not be overridden. |
| 31 | + // +optional |
| 32 | + Status ControllerManagerStatus `json:"status,omitzero"` |
| 33 | +} |
| 34 | + |
| 35 | +// ControllerManagerSpec defines the desired state of the Kubernetes controller manager |
| 36 | +// +kubebuilder:validation:MinProperties=1 |
| 37 | +type ControllerManagerSpec struct { |
| 38 | + // forceDetachOnTimeout expresses whether to allow kube-controller-manager |
| 39 | + // to force detach volumes when unmount takes longer than the timeout. |
| 40 | + // Valid values are Enabled and Disabled. If omitted, the default is Enabled. |
| 41 | + // +default="Enabled" |
| 42 | + // +optional |
| 43 | + ForceDetachOnTimeout ForceDetachOnTimeoutPolicy `json:"forceDetachOnTimeout,omitempty"` |
| 44 | +} |
| 45 | + |
| 46 | +// +kubebuilder:validation:Enum=Enabled;Disabled |
| 47 | +type ForceDetachOnTimeoutPolicy string |
| 48 | + |
| 49 | +const ( |
| 50 | + // ForceDetachOnTimeoutEnabled will allow kube-controller-manager to |
| 51 | + // force detach volumes based on maximum unmount time and node status. |
| 52 | + ForceDetachOnTimeoutEnabled ForceDetachOnTimeoutPolicy = "Enabled" |
| 53 | + // ForceDetachOnTimeoutDisabled will prevent kube-controller-manager |
| 54 | + // from force detaching volumes. |
| 55 | + ForceDetachOnTimeoutDisabled ForceDetachOnTimeoutPolicy = "Disabled" |
| 56 | +) |
| 57 | + |
| 58 | +// ControllerManagerStatus defines the observed state of the Kubernetes controller manager |
| 59 | +// +kubebuilder:validation:MinProperties=1 |
| 60 | +type ControllerManagerStatus struct { |
| 61 | +} |
| 62 | + |
| 63 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 64 | + |
| 65 | +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). |
| 66 | +// +openshift:compatibility-gen:level=1 |
| 67 | +type ControllerManagerList struct { |
| 68 | + metav1.TypeMeta `json:",inline"` |
| 69 | + |
| 70 | + // metadata is the standard list's metadata. |
| 71 | + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata |
| 72 | + metav1.ListMeta `json:"metadata"` |
| 73 | + |
| 74 | + Items []ControllerManager `json:"items"` |
| 75 | +} |
0 commit comments