From 82fde39403775cea4c8395c9bddf9246b7b1dec0 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 08:08:18 -0600 Subject: [PATCH 01/23] adding kuttl test stage --- .tekton/frontend-operator-pull-request.yaml | 43 +++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 7f87e6a1..40ecefb0 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -225,6 +225,49 @@ spec: cd ${FEO_PATH} make test + - name: run-kuttl-tests + description: run kuttl tests + params: + - name: SNAPSHOT + value: $(params.SNAPSHOT) + - name: NAMESPACE + value: $(params.NAMESPACE) + - name: EXPECTED_OUTPUT + value: $(params.EXPECTED_OUTPUT) + runAfter: + - clone-repository + workspaces: + - name: output + workspace: workspace + - name: basic-auth + workspace: git-auth + taskSpec: + params: + - name: SNAPSHOT + - name: NAMESPACE + - name: EXPECTED_OUTPUT + results: + - name: TEST_OUTPUT + description: Test output + steps: + - image: registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1712568462 + env: + - name: SNAPSHOT + value: $(params.SNAPSHOT) + - name: NAMESPACE + value: $(params.NAMESPACE) + - name: EXPECTED_OUTPUT + value: $(params.EXPECTED_OUTPUT) + - name: GOFLAGS + value: -buildvcs=false + script: | + #!/bin/bash + set -ex + + FEO_PATH="/workspace/output/source" + + cd ${FEO_PATH} + make kuttl - name: prefetch-dependencies params: - name: input From e2ef1dc5b292152a1e727ff04039fc3087284dce Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 08:22:24 -0600 Subject: [PATCH 02/23] install kubectl for konflux --- kuttl_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kuttl_test.sh b/kuttl_test.sh index 63cb5f0b..cf11c0ba 100755 --- a/kuttl_test.sh +++ b/kuttl_test.sh @@ -2,6 +2,9 @@ set -exv +# Install kubectl for Konflux +curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + # Install krew for kubectl ( set -x; cd "$(mktemp -d)" && From 9f063caee42d3c768dc18b54ff5cabe18a97d5f7 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 08:34:58 -0600 Subject: [PATCH 03/23] adding kubectl install to make kuttl command --- Makefile | 1 + kuttl_test.sh | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7e52dff3..0a5ca559 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,7 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build diff --git a/kuttl_test.sh b/kuttl_test.sh index cf11c0ba..63cb5f0b 100755 --- a/kuttl_test.sh +++ b/kuttl_test.sh @@ -2,9 +2,6 @@ set -exv -# Install kubectl for Konflux -curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - # Install krew for kubectl ( set -x; cd "$(mktemp -d)" && From 868e03bef329a00f44b06ee7f8f1ea2501509bd7 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 08:52:39 -0600 Subject: [PATCH 04/23] make kubectl executable --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0a5ca559..675ff664 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x ./kubectl KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From e31d513048b8b5a6e0b7cc76f80372af30b68848 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 09:29:30 -0600 Subject: [PATCH 05/23] setup kubectl on machine --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 675ff664..8d56e653 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,9 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x ./kubectl + chmod +x kubectl + mkdir -p ~/.local/bin + mv ./kubectl ~/.local/bin/kubectl KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From 27668387eaadae1d2cf8bfab263983dfc48b3941 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 09:39:53 -0600 Subject: [PATCH 06/23] run kubectl from tests dir --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8d56e653..73d9f7bc 100644 --- a/Makefile +++ b/Makefile @@ -117,9 +117,7 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x kubectl - mkdir -p ~/.local/bin - mv ./kubectl ~/.local/bin/kubectl + mv kubectl ./tests/e2e KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From b568fe94f50728e6e32308a9d817822e499e743a Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 09:48:46 -0600 Subject: [PATCH 07/23] checking path to dir --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 73d9f7bc..b03814e2 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - mv kubectl ./tests/e2e + pwd KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From 53297a715818718343d0cac919a44de3e7471834 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 09:57:11 -0600 Subject: [PATCH 08/23] appending kubectl to path var --- Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b03814e2..a7c7ec1b 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,27 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - pwd + chmod +x kubectl + mkdir -p ~/.local/bin + mv ./kubectl ~/.local/bin/kubectl + + # Install krew for kubectl + ( + set -x; cd "$(mktemp -d)" && + OS="$(uname | tr '[:upper:]' '[:lower:]')" && + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && + KREW="krew-${OS}_${ARCH}" && + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && + tar zxvf "${KREW}.tar.gz" && + ./"${KREW}" install krew + ) + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + export PATH="/bins:$PATH" + export PATH="/.local/bin:$PATH" + + # Install kuttl with krew + kubectl krew install kuttl + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From f63706dfc8ccaff90ab18338aae157aea6ab6049 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 10:20:45 -0600 Subject: [PATCH 09/23] fix syntax issue --- Makefile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index a7c7ec1b..e3bb261b 100644 --- a/Makefile +++ b/Makefile @@ -122,15 +122,14 @@ kuttl: manifests envtest generate fmt vet mv ./kubectl ~/.local/bin/kubectl # Install krew for kubectl - ( - set -x; cd "$(mktemp -d)" && - OS="$(uname | tr '[:upper:]' '[:lower:]')" && - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && - KREW="krew-${OS}_${ARCH}" && - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && - tar zxvf "${KREW}.tar.gz" && - ./"${KREW}" install krew - ) + set -x; cd "$(mktemp -d)" && + OS="$(uname | tr '[:upper:]' '[:lower:]')" && + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && + KREW="krew-${OS}_${ARCH}" && + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && + tar zxvf "${KREW}.tar.gz" && + ./"${KREW}" install krew + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" export PATH="/bins:$PATH" export PATH="/.local/bin:$PATH" From 727dd84e3a3939e38c0b80115c1db767b9a3e53f Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 10:26:35 -0600 Subject: [PATCH 10/23] fixing syntax issue --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e3bb261b..c849a158 100644 --- a/Makefile +++ b/Makefile @@ -122,13 +122,9 @@ kuttl: manifests envtest generate fmt vet mv ./kubectl ~/.local/bin/kubectl # Install krew for kubectl - set -x; cd "$(mktemp -d)" && - OS="$(uname | tr '[:upper:]' '[:lower:]')" && - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && - KREW="krew-${OS}_${ARCH}" && - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && - tar zxvf "${KREW}.tar.gz" && - ./"${KREW}" install krew + set -x; cd "$(mktemp -d)" && OS="$(uname | tr '[:upper:]' '[:lower:]')" && + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && KREW="krew-${OS}_${ARCH}" && + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && tar zxvf "${KREW}.tar.gz" && ./"${KREW}" install krew export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" export PATH="/bins:$PATH" From 735edfffef584249fd03e658e110712fef1f0bbc Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 10:31:37 -0600 Subject: [PATCH 11/23] syntax stuff --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c849a158..2acaa96c 100644 --- a/Makefile +++ b/Makefile @@ -122,10 +122,15 @@ kuttl: manifests envtest generate fmt vet mv ./kubectl ~/.local/bin/kubectl # Install krew for kubectl - set -x; cd "$(mktemp -d)" && OS="$(uname | tr '[:upper:]' '[:lower:]')" && - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && KREW="krew-${OS}_${ARCH}" && - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && tar zxvf "${KREW}.tar.gz" && ./"${KREW}" install krew - + ( + set -x; cd "$(mktemp -d)" && \ + OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ + KREW="krew-${OS}_${ARCH}" && \ + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ + tar zxvf "${KREW}.tar.gz" && \ + ./"${KREW}" install krew + ) export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" export PATH="/bins:$PATH" export PATH="/.local/bin:$PATH" From 8f9ff8939f3975c8c1e15c3f935bbc02221f51d6 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 10:36:09 -0600 Subject: [PATCH 12/23] fixes --- Makefile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2acaa96c..bece7f56 100644 --- a/Makefile +++ b/Makefile @@ -122,15 +122,14 @@ kuttl: manifests envtest generate fmt vet mv ./kubectl ~/.local/bin/kubectl # Install krew for kubectl - ( - set -x; cd "$(mktemp -d)" && \ - OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ - KREW="krew-${OS}_${ARCH}" && \ - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ - tar zxvf "${KREW}.tar.gz" && \ - ./"${KREW}" install krew - ) + set -x; cd "$(mktemp -d)" && \ + OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ + KREW="krew-${OS}_${ARCH}" && \ + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ + tar zxvf "${KREW}.tar.gz" && \ + ./"${KREW}" install krew + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" export PATH="/bins:$PATH" export PATH="/.local/bin:$PATH" From d72d3c480ac5878370b84d5476b98956de8e9595 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 10:54:15 -0600 Subject: [PATCH 13/23] updating image used for kuttl step --- .tekton/frontend-operator-pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 40ecefb0..9a8685c6 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -250,7 +250,7 @@ spec: - name: TEST_OUTPUT description: Test output steps: - - image: registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1712568462 + - image: registry.redhat.io/ubi8/ubi:8.10-1020 env: - name: SNAPSHOT value: $(params.SNAPSHOT) From 18a98b32c201b647b0af8cd17c09e4b04e2cd0c6 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 11:10:23 -0600 Subject: [PATCH 14/23] attempting new image --- .tekton/frontend-operator-pull-request.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 9a8685c6..830e180d 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -250,7 +250,7 @@ spec: - name: TEST_OUTPUT description: Test output steps: - - image: registry.redhat.io/ubi8/ubi:8.10-1020 + - image: fedora env: - name: SNAPSHOT value: $(params.SNAPSHOT) @@ -267,6 +267,8 @@ spec: FEO_PATH="/workspace/output/source" cd ${FEO_PATH} + + dnf install make make kuttl - name: prefetch-dependencies params: From 9eaf1972994ce1236029c7d5ba6277d9c2346c99 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 11:12:21 -0600 Subject: [PATCH 15/23] force install --- .tekton/frontend-operator-pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 830e180d..4dd5f5a6 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -268,7 +268,7 @@ spec: cd ${FEO_PATH} - dnf install make + dnf install make -y make kuttl - name: prefetch-dependencies params: From 2517a84faea4178e5151e5ea47cba4de6452235a Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 13:11:35 -0600 Subject: [PATCH 16/23] removing dnf install --- .tekton/frontend-operator-pull-request.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 4dd5f5a6..40ecefb0 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -250,7 +250,7 @@ spec: - name: TEST_OUTPUT description: Test output steps: - - image: fedora + - image: registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1712568462 env: - name: SNAPSHOT value: $(params.SNAPSHOT) @@ -267,8 +267,6 @@ spec: FEO_PATH="/workspace/output/source" cd ${FEO_PATH} - - dnf install make -y make kuttl - name: prefetch-dependencies params: From 2dee55dc6096e345d0ad6f0e8eff77aa2ce618d7 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 13:29:45 -0600 Subject: [PATCH 17/23] comment out code --- Makefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index bece7f56..e2ce315b 100644 --- a/Makefile +++ b/Makefile @@ -121,21 +121,21 @@ kuttl: manifests envtest generate fmt vet mkdir -p ~/.local/bin mv ./kubectl ~/.local/bin/kubectl - # Install krew for kubectl - set -x; cd "$(mktemp -d)" && \ - OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ - ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ - KREW="krew-${OS}_${ARCH}" && \ - curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ - tar zxvf "${KREW}.tar.gz" && \ - ./"${KREW}" install krew - - export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - export PATH="/bins:$PATH" - export PATH="/.local/bin:$PATH" - - # Install kuttl with krew - kubectl krew install kuttl + # # Install krew for kubectl + # set -x; cd "$(mktemp -d)" && \ + # OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ + # ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ + # KREW="krew-${OS}_${ARCH}" && \ + # curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ + # tar zxvf "${KREW}.tar.gz" && \ + # ./"${KREW}" install krew + + # export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + # export PATH="/bins:$PATH" + # export PATH="/.local/bin:$PATH" + + # # Install kuttl with krew + # kubectl krew install kuttl KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e From 821ff1b765412a6e365dbcaea57ea3858f37f9e5 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 13:48:40 -0600 Subject: [PATCH 18/23] trying to run downloaded kubectl --- Makefile | 8 +++----- kuttl_test.sh | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e2ce315b..3a8012e8 100644 --- a/Makefile +++ b/Makefile @@ -117,9 +117,7 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x kubectl - mkdir -p ~/.local/bin - mv ./kubectl ~/.local/bin/kubectl + chmod +x ./kubectl # # Install krew for kubectl # set -x; cd "$(mktemp -d)" && \ @@ -135,9 +133,9 @@ kuttl: manifests envtest generate fmt vet # export PATH="/.local/bin:$PATH" # # Install kuttl with krew - # kubectl krew install kuttl + # ./kubectl krew install kuttl - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ./kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build diff --git a/kuttl_test.sh b/kuttl_test.sh index 63cb5f0b..b988b8d2 100755 --- a/kuttl_test.sh +++ b/kuttl_test.sh @@ -12,6 +12,7 @@ set -exv tar zxvf "${KREW}.tar.gz" && ./"${KREW}" install krew ) + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" export PATH="/bins:$PATH" From 9e409a12a4e9ca7f397441c230c4cbd942e8ff1d Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Tue, 9 Jul 2024 13:54:25 -0600 Subject: [PATCH 19/23] adding kubectl download to temp dir --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3a8012e8..46b8c2e1 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,9 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x ./kubectl + chmod +x kubectl + mkdir -p ~/.local/bin + mv ./kubectl ~/.local/bin/kubectl # # Install krew for kubectl # set -x; cd "$(mktemp -d)" && \ @@ -130,12 +132,12 @@ kuttl: manifests envtest generate fmt vet # export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" # export PATH="/bins:$PATH" - # export PATH="/.local/bin:$PATH" + export PATH="/.local/bin:$PATH" # # Install kuttl with krew - # ./kubectl krew install kuttl + # kubectl krew install kuttl - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" ./kubectl kuttl test --config kuttl-config.yml ./tests/e2e + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e ##@ Build From 552e6794a2fd77e880ab79b876fd3e144d93498c Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Wed, 10 Jul 2024 11:09:16 -0600 Subject: [PATCH 20/23] updating string interpolation --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 46b8c2e1..21846aa8 100644 --- a/Makefile +++ b/Makefile @@ -130,9 +130,9 @@ kuttl: manifests envtest generate fmt vet # tar zxvf "${KREW}.tar.gz" && \ # ./"${KREW}" install krew - # export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - # export PATH="/bins:$PATH" - export PATH="/.local/bin:$PATH" + # export PATH="${KREW_ROOT:-${HOME}/.krew}/bin:${PATH}" + # export PATH="/bins:${PATH}" + export PATH="/.local/bin:${PATH}" # # Install kuttl with krew # kubectl krew install kuttl From acb41e3738e3fbeaffb3d97eb9ca465d4207c313 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Thu, 11 Jul 2024 14:25:15 -0600 Subject: [PATCH 21/23] testing custom image for e2e test stage --- .tekton/frontend-operator-pull-request.yaml | 2 +- Makefile | 31 +++++++++------------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 40ecefb0..6410c9bc 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -250,7 +250,7 @@ spec: - name: TEST_OUTPUT description: Test output steps: - - image: registry.access.redhat.com/ubi8/go-toolset:1.20.12-5.1712568462 + - image: quay.io/mknop_console_dot/konflux-go-kubectl:0001 env: - name: SNAPSHOT value: $(params.SNAPSHOT) diff --git a/Makefile b/Makefile index 21846aa8..fe35eae3 100644 --- a/Makefile +++ b/Makefile @@ -116,26 +116,21 @@ junit: gotestsum manifests envtest generate fmt vet # entry point for testing kuttl with kind kuttl: manifests envtest generate fmt vet - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x kubectl - mkdir -p ~/.local/bin - mv ./kubectl ~/.local/bin/kubectl - - # # Install krew for kubectl - # set -x; cd "$(mktemp -d)" && \ - # OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ - # ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ - # KREW="krew-${OS}_${ARCH}" && \ - # curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ - # tar zxvf "${KREW}.tar.gz" && \ - # ./"${KREW}" install krew - - # export PATH="${KREW_ROOT:-${HOME}/.krew}/bin:${PATH}" - # export PATH="/bins:${PATH}" + # Install krew for kubectl + set -x; cd "$(mktemp -d)" && \ + OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ + KREW="krew-${OS}_${ARCH}" && \ + curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && \ + tar zxvf "${KREW}.tar.gz" && \ + ./"${KREW}" install krew + + export PATH="${KREW_ROOT:-${HOME}/.krew}/bin:${PATH}" + export PATH="/bins:${PATH}" export PATH="/.local/bin:${PATH}" - # # Install kuttl with krew - # kubectl krew install kuttl + # Install kuttl with krew + kubectl krew install kuttl KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" kubectl kuttl test --config kuttl-config.yml ./tests/e2e From 5c4d4ddaa5c0beb018e1ee42a3a7815f96fbbeef Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Thu, 11 Jul 2024 14:28:23 -0600 Subject: [PATCH 22/23] fixing tag to latest --- .tekton/frontend-operator-pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tekton/frontend-operator-pull-request.yaml b/.tekton/frontend-operator-pull-request.yaml index 6410c9bc..e838f222 100644 --- a/.tekton/frontend-operator-pull-request.yaml +++ b/.tekton/frontend-operator-pull-request.yaml @@ -250,7 +250,7 @@ spec: - name: TEST_OUTPUT description: Test output steps: - - image: quay.io/mknop_console_dot/konflux-go-kubectl:0001 + - image: quay.io/mknop_console_dot/konflux-go-kubectl:latest env: - name: SNAPSHOT value: $(params.SNAPSHOT) From 904e0ab6a944481bb2111e239ed3afd6455898e0 Mon Sep 17 00:00:00 2001 From: Matt Knop Date: Fri, 12 Jul 2024 08:35:33 -0600 Subject: [PATCH 23/23] upgrade controller-gen --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe35eae3..ff52940c 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi CONTROLLER_GEN = $(shell pwd)/testbin/bin/controller-gen controller-gen: ## Download controller-gen locally if necessary. - $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0) + $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0) KUSTOMIZE = $(shell pwd)/testbin/bin/kustomize kustomize: ## Download kustomize locally if necessary.