From d4e40f1b5e0043f50d7eacb290c57418111cd6bc Mon Sep 17 00:00:00 2001 From: arkadeepsen Date: Tue, 9 Jul 2024 19:52:40 +0530 Subject: [PATCH 1/2] Checkout specific branch/tag of cloned coredns repo during build --- hack/build-coredns.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hack/build-coredns.sh b/hack/build-coredns.sh index b7d08fd5..ca343a17 100755 --- a/hack/build-coredns.sh +++ b/hack/build-coredns.sh @@ -10,6 +10,14 @@ set -euo pipefail PLUGIN_PATH=$(readlink -f "$(dirname "$0")/..") +# Get current branch name. If the current branch name does not match +# the pattern "release-*", then use master branch. +BRANCH_TAG=$(git rev-parse --abbrev-ref HEAD) +if [[ "${BRANCH_TAG}" != release-* ]] +then + BRANCH_TAG="master" +fi + # Create a temporary directory for cloning coredns repo. # The directory will be deleted after the execution of script. BASE_PATH=$(mktemp -d) @@ -20,9 +28,13 @@ COREDNS_URL="https://github.com/openshift/coredns" if [ ! -z "${1-}" ] && [ "${1}" = "upstream" ] then COREDNS_URL="https://github.com/coredns/coredns" + BRANCH_TAG="v$(curl -s https://raw.githubusercontent.com/openshift/coredns/${BRANCH_TAG}/coremain/version.go | grep CoreVersion | grep -Po '\d+\.\d+\.\d+')" fi echo "Cloning from ${COREDNS_URL}" git clone "${COREDNS_URL}" +cd "${BASE_PATH}"/coredns +echo "Checking out branch/tag ${BRANCH_TAG}" +git checkout ${BRANCH_TAG} # Add the "ocp_dnsnameresolver" plugin to the cloned coredns repo. "${PLUGIN_PATH}"/hack/add-plugin.sh "${BASE_PATH}"/coredns "${PLUGIN_PATH}" From 9d485ecf51ffa9c917be7974ebc163a9d6ae437b Mon Sep 17 00:00:00 2001 From: arkadeepsen Date: Mon, 22 Jul 2024 21:03:10 +0530 Subject: [PATCH 2/2] Add local CI config for build_root image --- .ci-operator.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .ci-operator.yaml diff --git a/.ci-operator.yaml b/.ci-operator.yaml new file mode 100644 index 00000000..56eab42e --- /dev/null +++ b/.ci-operator.yaml @@ -0,0 +1,4 @@ +build_root_image: + name: release + namespace: openshift + tag: golang-1.21