Skip to content
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
19 changes: 11 additions & 8 deletions support-bundle/support-bundle-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,18 +450,23 @@ function spectro-k8s-defaults() {
fi
done

CLUSTER_NS=$(kubectl get ns --output=custom-columns="Name:.metadata.name" --no-headers -l 'spectrocloud.com/cluster-name' 2>/dev/null)
if [[ -z "${CLUSTER_NS}" ]]; then
CLUSTER_NS=$(kubectl get ns -o=name | grep '^namespace/cluster-' | sed "s/^.\{10\}//")
CLUSTER_NSS=$(kubectl get ns --output=custom-columns="Name:.metadata.name" --no-headers -l 'spectrocloud.com/cluster-name' 2>/dev/null)
if [[ -z "${CLUSTER_NSS}" ]]; then
CLUSTER_NSS=$(kubectl get ns -o=name | grep '^namespace/cluster-' | sed "s/^.\{10\}//")
fi

if [[ -z "${CLUSTER_NS}" ]]; then
if [[ -z "${CLUSTER_NSS}" ]]; then
techo "Palette cluster namespace is empty."
else
for NS in $(echo $CLUSTER_NS | tr " " "\n"); do
for NS in $(echo $CLUSTER_NSS | tr " " "\n"); do
techo "Adding namespace $NS for logs collection."
SYSTEM_NAMESPACES+=("$NS")
done

if [[ "$NS" =~ [0-9a-fA-F\-]{8,} ]]; then
CLUSTER_NS="$NS"
techo "Cluster namespace: $CLUSTER_NS"
fi
done
fi

SYSTEM_UPGRADE_UUID_NS=$(kubectl get ns -o=name | grep '^namespace/system-upgrade-' | sed "s/^.\{10\}//")
Expand Down Expand Up @@ -753,8 +758,6 @@ function kubeadm-etcd() {

}



function canonical-k8s-dqlite() {
techo "Collecting Canonical k8s dqlite info"
DQLITE_DIR="/var/snap/k8s/common/var/lib/k8s-dqlite"
Expand Down
17 changes: 11 additions & 6 deletions support-bundle/support-bundle-infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ function spectro-k8s-defaults() {
fi
done

CLUSTER_NS=$(kubectl get ns --output=custom-columns="Name:.metadata.name" --no-headers -l 'spectrocloud.com/cluster-name' 2>/dev/null)
if [[ -z "${CLUSTER_NS}" ]]; then
CLUSTER_NS=$(kubectl get ns -o=name | grep '^namespace/cluster-' | sed "s/^.\{10\}//")
CLUSTER_NSS=$(kubectl get ns --output=custom-columns="Name:.metadata.name" --no-headers -l 'spectrocloud.com/cluster-name' 2>/dev/null)
if [[ -z "${CLUSTER_NSS}" ]]; then
CLUSTER_NSS=$(kubectl get ns -o=name | grep '^namespace/cluster-' | sed "s/^.\{10\}//")
fi

if [[ -z "${CLUSTER_NS}" ]]; then
if [[ -z "${CLUSTER_NSS}" ]]; then
techo "Palette cluster namespace is empty."
else
for NS in $(echo $CLUSTER_NS | tr " " "\n"); do
for NS in $(echo $CLUSTER_NSS | tr " " "\n"); do
techo "Adding namespace $NS for logs collection."
SYSTEM_NAMESPACES+=("$NS")
done

if [[ "$NS" =~ [0-9a-fA-F\-]{8,} ]]; then
CLUSTER_NS="$NS"
techo "Cluster namespace: $CLUSTER_NS"
fi
done
fi

SYSTEM_UPGRADE_UUID_NS=$(kubectl get ns -o=name | grep '^namespace/system-upgrade-' | sed "s/^.\{10\}//")
Expand Down