Skip to content

Commit

Permalink
Run fix_certs script automatically
Browse files Browse the repository at this point in the history
Workaround for openshift-metal3#260. Because life is too short for broken certs.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
  • Loading branch information
zaneb committed Apr 9, 2019
1 parent b09aaf2 commit 98ba9fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 06_create_cluster.sh
Expand Up @@ -46,6 +46,10 @@ fi
# Call kni-installer to deploy the bootstrap node and masters
create_cluster ocp

# Run the fix_certs.sh script periodically as a workaround for
# https://github.com/openshift-metalkube/dev-scripts/issues/260
sudo systemd-run --on-active=30s --on-unit-active=30m --unit=fix_certs.service $(dirname $0)/fix_certs.sh

# Update kube-system ep/host-etcd used by cluster-kube-apiserver-operator to
# generate storageConfig.urls
patch_ep_host_etcd "$CLUSTER_DOMAIN"
Expand Down
6 changes: 4 additions & 2 deletions fix_certs.sh
@@ -1,6 +1,8 @@
#!/bin/bash

# https://github.com/openshift-metalkube/dev-scripts/issues/141#issuecomment-474331659
# https://github.com/openshift-metalkube/dev-scripts/issues/260

export KUBECONFIG=$(dirname $0)/ocp/auth/kubeconfig
oc get csr -o name | xargs -n 1 oc adm certificate approve
for cert in $(oc get csr -o name); do
oc adm certificate approve "${cert}"
done
2 changes: 2 additions & 0 deletions ocp_cleanup.sh
Expand Up @@ -5,6 +5,8 @@ source logging.sh
source common.sh
source ocp_install_env.sh

sudo systemctl stop fix_certs.timer

if [ -d ocp ]; then
$GOPATH/src/github.com/openshift-metalkube/kni-installer/bin/kni-install --dir ocp --log-level=debug destroy bootstrap
$GOPATH/src/github.com/openshift-metalkube/kni-installer/bin/kni-install --dir ocp --log-level=debug destroy cluster
Expand Down

0 comments on commit 98ba9fb

Please sign in to comment.