Skip to content

Commit

Permalink
use official kubecompare
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 24, 2024
1 parent 9d1a6c8 commit 8c9521c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ztp/scripts/kube_compare.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
METADATA_FILE="${1:-/root/cnf-features-deploy/ztp/kube-compare-reference/metadata.yaml}"

if [ "$(which kubectl-cluster_compare)" == "" ] ; then
curl -L https://github.com/openshift/kube-compare/releases/download/v0.0.1/kube-compare_linux_amd64.tar.gz > kube-compare_linux_amd64.tar.gz
tar zxvf kube-compare_linux_amd64.tar.gz
mv kubectl-cluster_compare /usr/local/bin
podman create --name kca registry.redhat.io/openshift4/kube-compare-artifacts-rhel9:latest
podman cp kca:/usr/share/openshift/linux_amd64/kube-compare.rhel9 /usr/local/bin/kubectl_cluster-compare
podman rm -f kca
chmod u+x /usr/local/bin/kubectl-cluster_compare
fi
if [ ! -d /root/reference ] ; then
cd /root
# MINOR=$(openshift-install version | head -1 | cut -d' ' -f2 | cut -d. -f1,2)
# git clone --depth 1 --branch release-$MINOR https://github.com/openshift-kni/cnf-features-deploy
git clone https://github.com/openshift-kni/cnf-features-deploy
mkdir reference
cp -r cnf-features-deploy/ztp/source-crs/* reference
cp $METADATA_FILE reference/metadata.yaml
MINOR=$(openshift-install version | head -1 | cut -d' ' -f2 | cut -d. -f1,2)
{% if kubecompare_ran|default(true) %}
podman run -it registry.redhat.io/openshift4/openshift-telco-core-rds-rhel9:v$MINOR | base64 -d | tar xv -C /root/reference
{% else %}
podman run --rm --log-driver=none registry.redhat.io/openshift4/ztp-site-generate-rhel8:v$MINOR extract /home/ztp --tar | tar xv -C /root/reference
{% endif %}
fi
kubectl cluster-compare -r /root/reference/metadata.yaml

0 comments on commit 8c9521c

Please sign in to comment.