Skip to content
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

OCPNODE-2877: Remove support to configure cgroupsv1 in OCP #2181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
108 changes: 108 additions & 0 deletions config/v1/tests/nodes.config.openshift.io/AAA_ungated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,111 @@ tests:
apiVersion: config.openshift.io/v1
kind: Node
spec: {}
- name: Should be able to create a Node object with cgroupMode set to "v2"
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
expected: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
- name: Should not allow to create a Node object with the cgroupMode set to "v1"
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
expectedError: "spec.cgroupMode: Unsupported value: \"v1\""
- name: Should not allow to create a Node object with the cgroupMode set to unknown value
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "unknown"
expectedError: "spec.cgroupMode: Unsupported value: \"unknown\""
onUpdate:
- name: Should be able to update a Node object with cgroupMode set to "v2"
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec: {}
updated: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
expected: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
- name: Should not allow update of cgroupMode from "v2" to "v1"
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
updated: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
expectedError: "spec.cgroupMode: Unsupported value: \"v1\""
- name: Should allow changing fields other than cgroupMode when a persisted value "v1" is no longer valid
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/cgroupMode
value:
enum:
- v1
- v2
- ""
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
updated: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
workerLatencyProfile: "MediumUpdateAverageReaction"
expected: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
workerLatencyProfile: "MediumUpdateAverageReaction"
- name: Should allow updating a persisted value of cgroupMode that is no longer valid "v1" to a valid value "v2"
initialCRDPatches:
- op: replace
path: /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/cgroupMode
value:
enum:
- v1
- v2
- ""
type: string
initial: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v1"
workerLatencyProfile: "MediumUpdateAverageReaction"
updated: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
workerLatencyProfile: "MediumUpdateAverageReaction"
expected: |
apiVersion: config.openshift.io/v1
kind: Node
spec:
cgroupMode: "v2"
workerLatencyProfile: "MediumUpdateAverageReaction"
4 changes: 2 additions & 2 deletions config/v1/types_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ type NodeStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

// +kubebuilder:validation:Enum=v1;v2;""
// +kubebuilder:validation:Enum=v2;""
type CgroupMode string

const (
CgroupModeEmpty CgroupMode = "" // Empty string indicates to honor user set value on the system that should not be overridden by OpenShift
CgroupModeV1 CgroupMode = "v1"
CgroupModeV2 CgroupMode = "v2"
CgroupModeDefault CgroupMode = CgroupModeV1
CgroupModeDefault CgroupMode = CgroupModeV2
)

// +kubebuilder:validation:Enum=Default;MediumUpdateAverageReaction;LowUpdateSlowReaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ spec:
cgroupMode:
description: cgroupMode determines the cgroups version on the node
enum:
- v1
- v2
- ""
type: string
Expand Down