forked from openshift-metal3/dev-scripts
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove some cert approval related hacks."
This reverts commit a991cca. Some of the removed code is still needed. In particular, we still need to set the IPs on master Machines, as we have no other mechanism to do that. Without it, the master Machines and Nodes will not get linked, which the UI depends on. Related to issue openshift-metal3#260
- Loading branch information
Showing
5 changed files
with
77 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -x | ||
set -e | ||
|
||
source logging.sh | ||
source utils.sh | ||
source common.sh | ||
source ocp_install_env.sh | ||
|
||
for node in $(oc --config ocp/auth/kubeconfig get nodes -o template --template='{{range .items}}{{.metadata.uid}}:{{.metadata.name}}{{"\n"}}{{end}}'); do | ||
node_name=$(echo $node | cut -f2 -d':') | ||
machine_name=$CLUSTER_NAME-$node_name | ||
if [[ "$machine_name" == *"worker"* ]]; then | ||
machine_name=$(oc --config ocp/auth/kubeconfig get machines -n openshift-machine-api | grep $node_name | cut -f1 -d' ') | ||
fi | ||
$SCRIPTDIR/link-machine-and-node.sh "$machine_name" "$node" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
source utils.sh | ||
|
||
set -x | ||
set -e | ||
|
||
machine="$1" | ||
node="$2" | ||
|
||
if [ -z "$machine" -o -z "$node" ]; then | ||
echo "Usage: $0 MACHINE NODE" | ||
exit 1 | ||
fi | ||
|
||
uid=$(echo $node | cut -f1 -d':') | ||
node_name=$(echo $node | cut -f2 -d':') | ||
|
||
# BEGIN Hack #260 | ||
# Hack workaround for openshift-metalkube/dev-scripts#260 until it's done automatically | ||
# Also see https://github.com/metalkube/cluster-api-provider-baremetal/issues/49 | ||
oc --config ocp/auth/kubeconfig proxy & | ||
proxy_pid=$! | ||
|
||
PROXY_API_PATH="http://localhost:8001/apis/machine.openshift.io/v1beta1/namespaces/openshift-machine-api/machines" | ||
wait_for_json oc_proxy "${PROXY_API_PATH}" 10 -H "Accept: application/json" -H "Content-Type: application/json" | ||
|
||
addresses=$(oc --config ocp/auth/kubeconfig get node ${node_name} -o json | jq -c '.status.addresses') | ||
|
||
curl -X PATCH \ | ||
${PROXY_API_PATH}/${machine}/status \ | ||
-H "Content-type: application/merge-patch+json" \ | ||
-d '{"status":{"addresses":'"${addresses}"',"nodeRef":{"kind":"Node","name":"'"${node_name}"'","uid":"'"${uid}"'"}}}' | ||
|
||
kill $proxy_pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters