From 4eb18033451b9be47a21b6c6af069b024a2e902e Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Thu, 24 Apr 2025 12:23:11 +0300 Subject: [PATCH 01/10] Fix Tekton download script --- hack/tools/get-tekton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hack/tools/get-tekton.sh b/hack/tools/get-tekton.sh index 94fce4f0..1e96c41c 100644 --- a/hack/tools/get-tekton.sh +++ b/hack/tools/get-tekton.sh @@ -13,7 +13,10 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin UNAME_S=$(uname -s) UNAME_M=$(uname -m) -TEKTON_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt) +if [ "${TEKTON_VERSION}" == "" ] +then + TEKTON_VERSION=0.40.0 +fi if [ "Darwin" = "${UNAME_S}" ]; then echo "Downloading Tekton ${VERSION} ${UNAME_S} ${UNAME_M}" From 6c450d051423c25533fe5b01f36d58e2f9e1223b Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Thu, 24 Apr 2025 15:49:49 +0300 Subject: [PATCH 02/10] Fix OpenShift CLI download script --- hack/openshift/get-oc.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/hack/openshift/get-oc.sh b/hack/openshift/get-oc.sh index 48d14a08..6fa11ec0 100644 --- a/hack/openshift/get-oc.sh +++ b/hack/openshift/get-oc.sh @@ -12,29 +12,25 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin UNAME_S=$(uname -s) UNAME_M=$(uname -m) -rm -rf oc-tmp -mkdir oc-tmp - if [ "Darwin" = "${UNAME_S}" ]; then if [ "x86_64" = "${UNAME_M}" ]; then echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}" - curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o oc-tmp/openshift-client.tar.gz + curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-mac.tar.gz -o openshift-client.tar.gz else echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}" - curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o oc-tmp/openshift-client.tar.gz + curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-mac-arm64.tar.gz -o openshift-client.tar.gz fi else if [ "x86_64" = "${UNAME_M}" ]; then echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}" - curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz + curl -Ls https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz else echo "Downloading OpenShift OC CLI ${UNAME_S} ${UNAME_M}" - curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o oc-tmp/openshift-client.tar.gz + curl -Ls https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/stable/openshift-client-linux.tar.gz -o openshift-client.tar.gz fi fi -cd oc-tmp && tar -xvf openshift-client.tar.gz -mv oc-tmp/oc ${TOOLS_BIN}/oc -rm -rf oc-tmp - +tar -zxvf openshift-client.tar.gz oc +mv oc ${TOOLS_BIN}/oc chmod +x ${TOOLS_BIN}/oc +rm openshift-client.tar.gz From 26484f38a533eeee21c25b73fe96c44ffb333bdf Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Thu, 24 Apr 2025 18:26:49 +0300 Subject: [PATCH 03/10] Add Operator CI Tekton pipeline run --- tekton/operator-ci-run.yaml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tekton/operator-ci-run.yaml diff --git a/tekton/operator-ci-run.yaml b/tekton/operator-ci-run.yaml new file mode 100644 index 00000000..e3ff6c58 --- /dev/null +++ b/tekton/operator-ci-run.yaml @@ -0,0 +1,43 @@ +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: + generateName: operator-ci-run- +spec: + pipelineRef: + name: operator-ci + workspaces: + - name: shared-data + persistentVolumeClaim: + claimName: operator-ci-pvc + - name: dockerconfig + secret: + secretName: container-auth-json + - name: git-credentials + secret: + secretName: github-ssh-credentials + taskRunSpecs: + - pipelineTaskName: git-clone + podTemplate: + securityContext: + fsGroup: 65532 + timeouts: + pipeline: "2h3m0s" + tasks: "2h0m0s" + params: + - name: repo-url + value: git@github.com:thegridman/coherence-operator.git + - name: revision + value: tekton + - name: builder-image-prefix + value: "iad.ocir.io/odx-stateservice/tekton/builder" + - name: env-configmap + value: os-cert-config + - name: oci-tenancy-ocid + value: "ocid1.tenancy.oc1..aaaaaaaaztkccp2ubbxhhuftzvouv6t3b4sfencpgvsicrtmhwprk2mgahjq" + - name: oci-user-ocid + value: "ocid1.user.oc1..aaaaaaaa6vuuuw4vx3etfnugb6r34uyy2ovu2hbqivmazxylohc633pflkla" + - name: oci-region + value: "us-phoenix-1" + - name: oci-cli-secret + value: oci-cli-secret + From 85c95babbfb234ab613afaa21eb46f2bba34ab4d Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Sat, 26 Apr 2025 13:42:34 +0300 Subject: [PATCH 04/10] Update pipeline run yaml --- tekton/operator-ci-run.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tekton/operator-ci-run.yaml b/tekton/operator-ci-run.yaml index e3ff6c58..0882178b 100644 --- a/tekton/operator-ci-run.yaml +++ b/tekton/operator-ci-run.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1 kind: PipelineRun metadata: - generateName: operator-ci-run- + name: NAME_PLACEHOLDER spec: pipelineRef: name: operator-ci @@ -25,9 +25,9 @@ spec: tasks: "2h0m0s" params: - name: repo-url - value: git@github.com:thegridman/coherence-operator.git + value: GIT_REPO_PLACEHOLDER - name: revision - value: tekton + value: REVISION_PLACEHOLDER - name: builder-image-prefix value: "iad.ocir.io/odx-stateservice/tekton/builder" - name: env-configmap From e147d20c295b472c12dd1fa00941b14f95b4f452 Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Sun, 27 Apr 2025 13:45:03 +0300 Subject: [PATCH 05/10] Update tekton builder image --- tekton/builder.Dockerfile | 9 +-------- tekton/pipeline-operator-ci.yaml | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tekton/builder.Dockerfile b/tekton/builder.Dockerfile index f560afff..7a04dc62 100644 --- a/tekton/builder.Dockerfile +++ b/tekton/builder.Dockerfile @@ -1,6 +1,5 @@ FROM container-registry.oracle.com/os/oraclelinux:9 -ARG GoVersion ARG GoArch CMD ["/bin/bash"] @@ -9,12 +8,6 @@ RUN dnf install oracle-java-jdk-release-el* -y \ && dnf install jdk-21-headful -y \ && dnf install make which git -y -RUN curl -Ls https://go.dev/dl/$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \ - && rm -rf /usr/local/go \ - && tar -C /usr/local -xzf go-linux.tar.gz \ - && rm go-linux.tar.gz \ - && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ && chmod u+x kubectl \ && mv kubectl /usr/local/bin - -ENV PATH="$PATH:/usr/local/go/bin" diff --git a/tekton/pipeline-operator-ci.yaml b/tekton/pipeline-operator-ci.yaml index 788cdd70..ed67b0a3 100644 --- a/tekton/pipeline-operator-ci.yaml +++ b/tekton/pipeline-operator-ci.yaml @@ -154,7 +154,7 @@ spec: - name: IMAGE value: $(tasks.setup-env.results.BUILDER_IMAGE_NAME) - name: BUILD_EXTRA_ARGS - value: "--build-arg GoArch=$(tasks.setup-env.results.BUILD_ARCH) --build-arg GoVersion=$(tasks.setup-env.results.OPERATOR_GO_VERSION)" + value: "--build-arg GoArch=$(tasks.setup-env.results.BUILD_ARCH)" - name: httpProxy value: $(params.httpProxy) - name: httpsProxy From 70419813eecf0a29ab70410c2dbe63b50d7c8172 Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Sun, 27 Apr 2025 14:30:11 +0300 Subject: [PATCH 06/10] Update tekton builder image --- tekton/builder.Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tekton/builder.Dockerfile b/tekton/builder.Dockerfile index 7a04dc62..f970e125 100644 --- a/tekton/builder.Dockerfile +++ b/tekton/builder.Dockerfile @@ -8,6 +8,12 @@ RUN dnf install oracle-java-jdk-release-el* -y \ && dnf install jdk-21-headful -y \ && dnf install make which git -y -RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ +RUN curl -Ls https://go.dev/dl/go1.24.2.darwin-$GoArch.tar.gz -o go-linux.tar.gz \ + && rm -rf /usr/local/go \ + && tar -C /usr/local -xzf go-linux.tar.gz \ + && rm go-linux.tar.gz \ + && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ && chmod u+x kubectl \ && mv kubectl /usr/local/bin + +ENV PATH="$PATH:/usr/local/go/bin" From cf9532e2162a8a913009638f60c229fc6b3c96cf Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Sun, 27 Apr 2025 15:23:35 +0300 Subject: [PATCH 07/10] Update tekton builder image --- tekton/builder.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tekton/builder.Dockerfile b/tekton/builder.Dockerfile index f970e125..a75300de 100644 --- a/tekton/builder.Dockerfile +++ b/tekton/builder.Dockerfile @@ -8,11 +8,11 @@ RUN dnf install oracle-java-jdk-release-el* -y \ && dnf install jdk-21-headful -y \ && dnf install make which git -y -RUN curl -Ls https://go.dev/dl/go1.24.2.darwin-$GoArch.tar.gz -o go-linux.tar.gz \ +RUN curl -Ls https://go.dev/dl/go1.24.2.linux-amd64.tar.gz -o go-linux.tar.gz \ && rm -rf /usr/local/go \ && tar -C /usr/local -xzf go-linux.tar.gz \ && rm go-linux.tar.gz \ - && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ + && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ && chmod u+x kubectl \ && mv kubectl /usr/local/bin From a7ca5ec79f3fbb4c5eae54c7e3cb7762263ac603 Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Mon, 28 Apr 2025 10:22:47 +0300 Subject: [PATCH 08/10] Fixing tekton builder image --- tekton/builder.Dockerfile | 5 +++-- tekton/pipeline-operator-ci.yaml | 2 +- tekton/task-setup-env.yaml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tekton/builder.Dockerfile b/tekton/builder.Dockerfile index a75300de..f560afff 100644 --- a/tekton/builder.Dockerfile +++ b/tekton/builder.Dockerfile @@ -1,5 +1,6 @@ FROM container-registry.oracle.com/os/oraclelinux:9 +ARG GoVersion ARG GoArch CMD ["/bin/bash"] @@ -8,11 +9,11 @@ RUN dnf install oracle-java-jdk-release-el* -y \ && dnf install jdk-21-headful -y \ && dnf install make which git -y -RUN curl -Ls https://go.dev/dl/go1.24.2.linux-amd64.tar.gz -o go-linux.tar.gz \ +RUN curl -Ls https://go.dev/dl/$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \ && rm -rf /usr/local/go \ && tar -C /usr/local -xzf go-linux.tar.gz \ && rm go-linux.tar.gz \ - && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ + && curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$GoArch/kubectl" \ && chmod u+x kubectl \ && mv kubectl /usr/local/bin diff --git a/tekton/pipeline-operator-ci.yaml b/tekton/pipeline-operator-ci.yaml index ed67b0a3..788cdd70 100644 --- a/tekton/pipeline-operator-ci.yaml +++ b/tekton/pipeline-operator-ci.yaml @@ -154,7 +154,7 @@ spec: - name: IMAGE value: $(tasks.setup-env.results.BUILDER_IMAGE_NAME) - name: BUILD_EXTRA_ARGS - value: "--build-arg GoArch=$(tasks.setup-env.results.BUILD_ARCH)" + value: "--build-arg GoArch=$(tasks.setup-env.results.BUILD_ARCH) --build-arg GoVersion=$(tasks.setup-env.results.OPERATOR_GO_VERSION)" - name: httpProxy value: $(params.httpProxy) - name: httpsProxy diff --git a/tekton/task-setup-env.yaml b/tekton/task-setup-env.yaml index c7136ce4..a0375225 100644 --- a/tekton/task-setup-env.yaml +++ b/tekton/task-setup-env.yaml @@ -44,7 +44,7 @@ spec: BUILD_ARCH=amd64 fi DOCKER_FILE_SHA1SUM=$(sha1sum "${SOURCE_DIRECTORY}/tekton/builder.Dockerfile") - OPERATOR_GO_VERSION=$(sed -n -e 's/^toolchain \(.*\)$/\1/p' ${SOURCE_DIRECTORY}/go.mod) + OPERATOR_GO_VERSION=$(cat ${SOURCE_DIRECTORY}/.go-version) readarray -d ' ' -t DOCKER_FILE_SHA <<< "${DOCKER_FILE_SHA1SUM}" LATEST_GO=$(curl -s 'https://go.dev/VERSION?m=text' | head -n 1) BUILDER_IMAGE_NAME="${PARAM_BUILDER_IMAGE_PREFIX}:${DOCKER_FILE_SHA}-${OPERATOR_GO_VERSION}-${BUILD_ARCH}" From 18908c8e2a436ed2ee715eddf3ff7d1c704f5f4a Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Mon, 28 Apr 2025 12:17:52 +0300 Subject: [PATCH 09/10] Fixing tekton builder image --- tekton/builder.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tekton/builder.Dockerfile b/tekton/builder.Dockerfile index f560afff..d2933d70 100644 --- a/tekton/builder.Dockerfile +++ b/tekton/builder.Dockerfile @@ -9,7 +9,7 @@ RUN dnf install oracle-java-jdk-release-el* -y \ && dnf install jdk-21-headful -y \ && dnf install make which git -y -RUN curl -Ls https://go.dev/dl/$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \ +RUN curl -Ls https://go.dev/dl/go$GoVersion.linux-$GoArch.tar.gz -o go-linux.tar.gz \ && rm -rf /usr/local/go \ && tar -C /usr/local -xzf go-linux.tar.gz \ && rm go-linux.tar.gz \ From d0d82e3878900b4a8ffb595d275ac1641d8b37d8 Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Mon, 28 Apr 2025 13:29:47 +0300 Subject: [PATCH 10/10] Fix pipeline rbac yaml --- tekton/rbac-pipeline-admin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tekton/rbac-pipeline-admin.yaml b/tekton/rbac-pipeline-admin.yaml index c28b1fa4..48e03903 100644 --- a/tekton/rbac-pipeline-admin.yaml +++ b/tekton/rbac-pipeline-admin.yaml @@ -9,4 +9,4 @@ roleRef: subjects: - kind: ServiceAccount name: pipeline - namespace: coherence-cert \ No newline at end of file + namespace: NAMESPACE_HOLDER \ No newline at end of file