From d1e2e497ebf78edc9e3c2b14791f9253d66c8f04 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Petersen" Date: Thu, 21 Sep 2023 12:53:51 -0400 Subject: [PATCH] fix imgpkg output --- .../build_and_deploy_for_integration_tests.sh | 26 ++++++++++++++----- deploy_carvel/concierge/.imgpkg/images.yml | 8 ++++++ .../package-repository/.imgpkg/images.yml | 4 +-- deploy_carvel/supervisor/.imgpkg/images.yml | 8 ++++++ .../supervisor-pkginstall.yml | 2 +- 5 files changed, 38 insertions(+), 10 deletions(-) diff --git a/deploy_carvel/build_and_deploy_for_integration_tests.sh b/deploy_carvel/build_and_deploy_for_integration_tests.sh index 24fa88c5..2889c20b 100755 --- a/deploy_carvel/build_and_deploy_for_integration_tests.sh +++ b/deploy_carvel/build_and_deploy_for_integration_tests.sh @@ -30,6 +30,18 @@ echo_blue() { # printf "${BLUE}$@${DEFAULT}" } +# tag=$(uuidgen) # always a new tag to force K8s to reload the image on redeploy +# build_and_deploy_for_integration_tests.sh 123455 +echo "" +echo "" +tag=${1} # need to manually pass this, use the same from prepare-for-integreation-tests.sh +echo_yellow "using tag: ${tag}" +echo_yellow "does this match output tag from prepare-for-integration-test.sh?" +echo "" +echo "" +sleep 3 # just to give enough time to see it for a human + + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # got a cluster? @@ -61,11 +73,7 @@ registry="pinniped.local" # Hack, but not what we really want: getpinniped/pinni repo="test/build" registry_repo="$registry/$repo" -# tag=$(uuidgen) # always a new tag to force K8s to reload the image on redeploy -# build_and_deploy_for_integration_tests.sh 123455 -tag=${1} # need to manually pass this, use the same from prepare-for-integreation-tests.sh -echo_yellow "using tag: ${tag}" -sleep 1 # just to give enough time to see it for a human + api_group_suffix="pinniped.dev" # END PINNIPED IMAGE, NOT PACKAGE -------------- >>>> @@ -116,8 +124,12 @@ do # just simple templating echo_yellow "generating ${resource_name}/.imgpkg/images.yaml" - # there are bits for image substitution in some of the ytt commands - kbld --file "${SCRIPT_DIR}/${resource_name}/config/" --imgpkg-lock-output "${SCRIPT_DIR}/${resource_name}/.imgpkg/images.yml" + + # in order to run kbld to generate correct imgpkg lock files, + # we must ytt render the templates and then pass the output to kbld + ytt \ + --file "${SCRIPT_DIR}/${resource_name}/config/" | \ + kbld -f- --imgpkg-lock-output "${SCRIPT_DIR}/${resource_name}/.imgpkg/images.yml" # generate a schema in each package directory echo_yellow "generating ${SCRIPT_DIR}/${resource_name}/schema-openapi.yaml" diff --git a/deploy_carvel/concierge/.imgpkg/images.yml b/deploy_carvel/concierge/.imgpkg/images.yml index 2992cdee..adc53f2c 100644 --- a/deploy_carvel/concierge/.imgpkg/images.yml +++ b/deploy_carvel/concierge/.imgpkg/images.yml @@ -1,3 +1,11 @@ --- apiVersion: imgpkg.carvel.dev/v1alpha1 +images: +- annotations: + kbld.carvel.dev/id: projects.registry.vmware.com/pinniped/pinniped-server:latest + kbld.carvel.dev/origins: | + - resolved: + tag: latest + url: projects.registry.vmware.com/pinniped/pinniped-server:latest + image: projects.registry.vmware.com/pinniped/pinniped-server@sha256:a92183de893eb0b1850cc3a1d33306b96ba2cdb72a8a49c6493a58c01b4fa9cd kind: ImagesLock diff --git a/deploy_carvel/package-repository/.imgpkg/images.yml b/deploy_carvel/package-repository/.imgpkg/images.yml index 62fc5bcf..cbc34863 100644 --- a/deploy_carvel/package-repository/.imgpkg/images.yml +++ b/deploy_carvel/package-repository/.imgpkg/images.yml @@ -7,12 +7,12 @@ images: - resolved: tag: 0.25.0 url: benjaminapetersen/pinniped-package-repo-package-concierge:0.25.0 - image: index.docker.io/benjaminapetersen/pinniped-package-repo-package-concierge@sha256:bcf825330cf8946b4c9a7a0cc7a774748dd519c4fe1c22a076b64dc9f369c59c + image: index.docker.io/benjaminapetersen/pinniped-package-repo-package-concierge@sha256:8cfac137dcb7e3edcf0dcc9d032ff67c9d26a7ce863ead5b28bff457336ad3e0 - annotations: kbld.carvel.dev/id: benjaminapetersen/pinniped-package-repo-package-supervisor:0.25.0 kbld.carvel.dev/origins: | - resolved: tag: 0.25.0 url: benjaminapetersen/pinniped-package-repo-package-supervisor:0.25.0 - image: index.docker.io/benjaminapetersen/pinniped-package-repo-package-supervisor@sha256:12577787d82b4f565be28c65c229c87dd8ac9890d0f44a690725fdb4ac7f4082 + image: index.docker.io/benjaminapetersen/pinniped-package-repo-package-supervisor@sha256:f59ad2eb1737f2098e1cd4957f062b0c01de9d1ab7230c58093ab16d2192e302 kind: ImagesLock diff --git a/deploy_carvel/supervisor/.imgpkg/images.yml b/deploy_carvel/supervisor/.imgpkg/images.yml index 2992cdee..adc53f2c 100644 --- a/deploy_carvel/supervisor/.imgpkg/images.yml +++ b/deploy_carvel/supervisor/.imgpkg/images.yml @@ -1,3 +1,11 @@ --- apiVersion: imgpkg.carvel.dev/v1alpha1 +images: +- annotations: + kbld.carvel.dev/id: projects.registry.vmware.com/pinniped/pinniped-server:latest + kbld.carvel.dev/origins: | + - resolved: + tag: latest + url: projects.registry.vmware.com/pinniped/pinniped-server:latest + image: projects.registry.vmware.com/pinniped/pinniped-server@sha256:a92183de893eb0b1850cc3a1d33306b96ba2cdb72a8a49c6493a58c01b4fa9cd kind: ImagesLock diff --git a/deploy_carvel/temp_actual_deploy_resources/supervisor-pkginstall.yml b/deploy_carvel/temp_actual_deploy_resources/supervisor-pkginstall.yml index f9561084..3eb80334 100644 --- a/deploy_carvel/temp_actual_deploy_resources/supervisor-pkginstall.yml +++ b/deploy_carvel/temp_actual_deploy_resources/supervisor-pkginstall.yml @@ -27,7 +27,7 @@ stringData: namespace: supervisor api_group_suffix: pinniped.dev image_repo: pinniped.local/test/build - image_tag: 24753D27-6217-4E65-B508-71CB1DAF70D3 + image_tag: 160E1A5F-409E-431A-9CFC-53825C6978C7 log_level: debug service_https_nodeport_port: 443