From 2c957202b17f6d9aecd380237cbd65c1784a96ff Mon Sep 17 00:00:00 2001 From: ehila Date: Fri, 30 Jan 2026 10:28:48 -0500 Subject: [PATCH] feat: add support for feature gates added the ability to add a comma seperated list of feature gates to be ingested and parsed into the install-config.yaml Co-Authored-By: Claude Signed-off-by: ehila --- .../templates/install-config_baremetal_yaml.j2 | 6 ++++++ .../templates/install-config_vsphere_yaml.j2 | 6 ++++++ .../manifests/templates/install-config_yaml.j2 | 6 ++++++ agent/roles/manifests/vars/main.yml | 1 + config_example.sh | 18 ++++++++++++++++++ ocp_install_env.sh | 14 ++++++++++++++ 6 files changed, 51 insertions(+) diff --git a/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 b/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 index e6d4edaf6..898e29987 100644 --- a/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 @@ -21,6 +21,12 @@ arbiter: {% if feature_set %} featureSet: {{ feature_set }} {% endif %} +{% if feature_gates %} +featureGates: +{% for gate in feature_gates.split(',') %} +- {{ gate }} +{% endfor %} +{% endif %} controlPlane: architecture: {{ goCPUArchitecture }} hyperthreading: Enabled diff --git a/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 b/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 index 3b0a67c26..1314d463f 100644 --- a/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 @@ -15,6 +15,12 @@ arbiter: {% if feature_set %} featureSet: {{ feature_set }} {% endif %} +{% if feature_gates %} +featureGates: +{% for gate in feature_gates.split(',') %} +- {{ gate }} +{% endfor %} +{% endif %} controlPlane: architecture: {{ goCPUArchitecture }} hyperthreading: Enabled diff --git a/agent/roles/manifests/templates/install-config_yaml.j2 b/agent/roles/manifests/templates/install-config_yaml.j2 index a9855802c..6cc491b57 100644 --- a/agent/roles/manifests/templates/install-config_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_yaml.j2 @@ -15,6 +15,12 @@ arbiter: {% if feature_set %} featureSet: {{ feature_set }} {% endif %} +{% if feature_gates %} +featureGates: +{% for gate in feature_gates.split(',') %} +- {{ gate }} +{% endfor %} +{% endif %} controlPlane: architecture: {{ goCPUArchitecture }} hyperthreading: Enabled diff --git a/agent/roles/manifests/vars/main.yml b/agent/roles/manifests/vars/main.yml index 9e5a73c18..0231f6cc9 100644 --- a/agent/roles/manifests/vars/main.yml +++ b/agent/roles/manifests/vars/main.yml @@ -54,6 +54,7 @@ num_masters: "{{ lookup('env', 'NUM_MASTERS') }}" num_workers: "{{ lookup('env', 'NUM_WORKERS') }}" num_arbiters: "{{ lookup('env', 'NUM_ARBITERS') }}" feature_set: "{{ lookup('env', 'FEATURE_SET') }}" +feature_gates: "{{ lookup('env', 'FEATURE_GATES') }}" num_extra_workers: "{{ lookup('env', 'NUM_EXTRA_WORKERS', default='0') }}" no_proxy: "{{ lookup('env', 'AGENT_NO_PROXY') }}" platform_type: "{{ lookup('env', 'AGENT_PLATFORM_TYPE') }}" diff --git a/config_example.sh b/config_example.sh index c8042590b..04e61a591 100755 --- a/config_example.sh +++ b/config_example.sh @@ -512,6 +512,24 @@ set -x # #ADDITIONAL_CAPABILITIES=baremetal,Console +# FEATURE_SET - +# Enable a feature set for the cluster. Feature sets are a collection of features that +# are enabled together. +# Default: Undefined (uses the default feature set) +# +# For more info see: +# https://docs.openshift.com/container-platform/latest/nodes/clusters/nodes-cluster-enabling-features.html +# +#export FEATURE_SET="TechPreviewNoUpgrade" + +# FEATURE_GATES - +# Enable specific feature gates for the cluster. This should be provided as a +# comma-separated list of feature gate names as key=value pairs, where value is a boolean of true or false. +# Default: Undefined +# +# Example: +#export FEATURE_GATES="ExampleFeatureGateA=true,ExampleFeatureGateB=false" + # MASTER_HOSTNAME_FORMAT - # Set a custom hostname format for masters. This is a format string that should # include one %d field, which will be replaced with the number of the node. diff --git a/ocp_install_env.sh b/ocp_install_env.sh index 516007195..3df4f2a21 100644 --- a/ocp_install_env.sh +++ b/ocp_install_env.sh @@ -208,6 +208,19 @@ EOF fi } +function featureGates() { + if [[ -n "$FEATURE_GATES" ]]; then +cat <