Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 4e9c75a

Browse files
authored
Merge pull request #302 from akavel/kind-collisions
template-processors/base: use fully qualified kind names in kubectl (#273)
2 parents 0050d05 + e31e0f7 commit 4e9c75a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ shellcheck:
9595

9696
.PHONY: e2e-test-images
9797
e2e-test-images: build
98-
TRAVIS_TAG=v999.0.0 ./scripts/build-images.sh ${REPOSITORY}
98+
TRAVIS_TAG=latest ./scripts/build-images.sh ${REPOSITORY}
9999

100100
# Deploy images to Quay.io
101101
.PHONY: travis-deploy-images

template-processors/base/bin/resourceManager.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ function addLabels() {
5959
function deleteByOldLabels() {
6060
local owner="$1"
6161
local timestamp="${2:-}"
62-
# NOTE: removing componentstatus because it shows up unintended in ownedKinds: https://github.com/kubernetes/kubectl/issues/151#issuecomment-562578617
63-
local allKinds="$(kube api-resources --verbs=list -o name | grep -ivE '^componentstatus(es)?$' | paste -sd, -)"
62+
local allKinds="$(kube api-resources --verbs=list,delete -o name | paste -sd, -)"
6463
local ownedKinds="$(kube get "$allKinds" --ignore-not-found \
6564
-l "$TAG_OWNER==$owner" \
66-
-o custom-columns=kind:.kind \
67-
--no-headers=true |
65+
-o jsonpath="{range .items[*]}{.kind} {.apiVersion}{'\n'}{end}" | # e.g. "Pod v1" OR "StorageClass storage.k8s.io/v1"
6866
sort -u |
67+
awk -F'[ /]' '{if (NF==2) {print $1} else {print $1"."$3"."$2}}' | # e.g. "Pod" OR "StorageClass.v1.storage.k8s.io"
6968
paste -sd, -)"
7069
if [ -z "$ownedKinds" ]; then
7170
return

0 commit comments

Comments
 (0)