Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "ControllerManager"
crdName: controllermanagers.config.openshift.io
featureGates:
- DisableForceDetachOnTimeout
tests:
onCreate:
- name: Should be able to create with default values
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout:
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Enabled
- name: Should be able to create with force detach enabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Enabled
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Enabled
- name: Should be able to create with force detach disabled
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Disabled
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Disabled
- name: Should reject unsupported value of forceDetachOnTimeout
initial: |
apiVersion: config.openshift.io/v1alpha1
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/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Enabled
updated: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Disabled
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Disabled
- name: Disabled to default value
initial: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Disabled
updated: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout:
expected: |
apiVersion: config.openshift.io/v1alpha1
kind: ControllerManager
spec:
forceDetachOnTimeout: Enabled
76 changes: 76 additions & 0 deletions config/v1alpha1/types_controllermanager.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package v1alpha1

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 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
// +openshift:compatibility-gen:level=4
// +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
// +openshift:enable:FeatureGate=DisableForceDetachOnTimeout
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 {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
// +openshift:compatibility-gen:level=4
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"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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"
release.openshift.io/feature-set: CustomNoUpgrade
name: controllermanagers.config.openshift.io
spec:
group: config.openshift.io
names:
kind: ControllerManager
listKind: ControllerManagerList
plural: controllermanagers
singular: controllermanager
scope: Cluster
versions:
- name: v1alpha1
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 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
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: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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"
release.openshift.io/feature-set: DevPreviewNoUpgrade
name: controllermanagers.config.openshift.io
spec:
group: config.openshift.io
names:
kind: ControllerManager
listKind: ControllerManagerList
plural: controllermanagers
singular: controllermanager
scope: Cluster
versions:
- name: v1alpha1
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 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
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: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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"
release.openshift.io/feature-set: TechPreviewNoUpgrade
name: controllermanagers.config.openshift.io
spec:
group: config.openshift.io
names:
kind: ControllerManager
listKind: ControllerManagerList
plural: controllermanagers
singular: controllermanager
scope: Cluster
versions:
- name: v1alpha1
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 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
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: {}
Loading