Skip to content
Open
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
Expand Up @@ -37,20 +37,6 @@ function approve_csrs() {
done
}

# Add 'node.openshift.io/platform-type=vsphere' label to any node that is missing it.
function label_vsphere_nodes() {
echo "$(date -u --rfc-3339=seconds) - Adding labels to vsphere nodes for builds that do not have upstream ccm changes..."
NODES=$(oc get nodes -o name --kubeconfig="${CLUSTER_KUBECONFIG}")
for node in ${NODES}; do
echo "$(date -u --rfc-3339=seconds) - Checking ${node}"
LABEL_FOUND=$(oc get ${node} -o json | jq -r '.metadata.labels | has("node.openshift.io/platform-type")')
if [ "${LABEL_FOUND}" == "false" ]; then
echo "$(date -u --rfc-3339=seconds) - Adding 'node.openshift.io/platform-type=vsphere' label"
oc label "${node}" "node.openshift.io/platform-type"=vsphere --kubeconfig="${CLUSTER_KUBECONFIG}"
fi
done
}

# Enable storage operator / capability. If operator is already enabled, this function will log no changes made and operator is ready.
function enable_storage_operator() {
echo "$(date -u --rfc-3339=seconds) - Enabling storage capability (operator)..."
Expand Down Expand Up @@ -111,10 +97,6 @@ function patch_csi_driver_removed() {
oc patch clustercsidriver csi.vsphere.vmware.com --type=merge --patch 'spec: {managementState: "Removed"}'
}

# We are going to apply the 'node.openshift.io/platform-type=vsphere' label to all existing nodes as a workaround while waiting for upstream CCM changes
# When upstream changes are merged downstream, the function will output that no nodes were updated.
label_vsphere_nodes

# Enable storage operator now that the labels are in place
if [ "${ENABLE_HYBRID_STORAGE}" == "true" ]; then
enable_storage_operator
Expand Down