Skip to content

OCPEDGE-1734: feat: add ability to define capability set #1769

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

Merged
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
22 changes: 22 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,28 @@ set -x
#
#export ENABLE_WORKLOAD_PARTITIONING=true

# BASELINE_CAPABILITY_SET -
# Set a baseline capability set for optional components when deploying a cluster.
#
# Baseline capabilities allow users to be more selective about which operators to include during install to lesson the consumption
# of the OpenShift cluster.
# For more info see:
# https://github.com/openshift/enhancements/blob/master/enhancements/installer/component-selection.md
#
#BASELINE_CAPABILITY_SET=None

# ADDITIONAL_CAPABILITIES -
# Set a additional capabilities to be added to the cluster. You MUST provide a BASELINE_CAPABILITY_SET if ADDITIONAL_CAPABILITIES is set.
#
# ADDITIONAL_CAPABILITIES must be provided as a comma separated list.
# Additional capabilities allow users to be more selective about which operators to include during install additional to the base capability set.
#
# For more info see:
# https://github.com/openshift/enhancements/blob/master/enhancements/installer/component-selection.md#install-configuration
# https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/installation_overview/cluster-capabilities#cluster-capabilities
#
#ADDITIONAL_CAPABILITIES=baremetal,Console

# 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.
Expand Down
26 changes: 26 additions & 0 deletions ocp_install_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,31 @@ EOF
fi
}

function capabilities_stanza() {
if [[ -n "$BASELINE_CAPABILITY_SET" ]]; then
cat <<EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing indentation (same below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the cat command indentation @dtantsur , or the things its catting? The cat is following the indentation I saw in the other commands, but I can indent that, I just don't think I can indent the content of it with out causing yaml issues.

capabilities:
baselineCapabilitySet: "$BASELINE_CAPABILITY_SET"
EOF
fi

if [[ -n "$BASELINE_CAPABILITY_SET" ]] && [[ -n "$ADDITIONAL_CAPABILITIES" ]]; then
cat << EOF
additionalEnabledCapabilities:
EOF

for cap in ${ADDITIONAL_CAPABILITIES//,/ }; do
cat << EOF
- ${cap}
EOF
done

elif [[ -n "$ADDITIONAL_CAPABILITIES" ]] && [[ -z "$BASELINE_CAPABILITY_SET" ]]; then
echo "Additional capabilities is set to: $ADDITIONAL_CAPABILITIES, but no desired BASELINE_CAPABILITY_SET is set"
exit 1
fi
}

function arbiter_stanza() {
if [[ -n "${ENABLE_ARBITER:-}" ]]; then
cat <<EOF
Expand Down Expand Up @@ -340,6 +365,7 @@ controlPlane:
$(node_map_to_install_config_fencing_credentials)
$(arbiter_stanza)
$(featureSet)
$(capabilities_stanza)
platform:
baremetal:
$(libvirturi)
Expand Down