From 646fad02c4cd6132a5d5883d8716c314fb018f18 Mon Sep 17 00:00:00 2001 From: Chuck D'Antonio Date: Thu, 2 Nov 2023 21:34:26 -0400 Subject: [PATCH] Addresses pre-Kubecon feedback from Marketing (#316) TL;DR ----- Repairs several defects surfaced while reviewing labs before Kubecon Details ------- * Fixes lab setup to create a customer even when thee `vendor.json` file doesn't specify any files for the release. * Uses a newer version of the Harbor chart for the "builder" labs to both sync back up and address some issues with Helm installs * Creates release from chart tarball rather than from the YAML dir * Assures created customers aren't KOTS enabled * Corrects some lifecycle scripts that were leading to inconsistent lab instructions and some failures that weren't failures * Clears a couple of typos --- .../assignment.md | 4 +- .../assignment.md | 2 +- .../assignment.md | 6 +- .../check-shell | 2 +- .../solve-shell | 2 +- .../assignment.md | 10 +- .../04-releasing-the-application/check-shell | 12 +- .../04-releasing-the-application/solve-shell | 6 +- .../assignment.md | 4 +- .../solve-shell | 2 +- .../06-completing-the-install/assignment.md | 2 +- .../06-completing-the-install/check-shell | 2 +- .../avoiding-installation-pitfalls/config.yml | 2 +- .../avoiding-installation-pitfalls/track.yml | 10 +- .../track_scripts/setup-shell | 15 +- .../01-viewing-instance-info/assignment.md | 2 +- .../01-viewing-instance-info/check-shell | 5 + .../assignment.md | 6 +- .../03-additional-information/assignment.md | 2 +- .../04-adding-to-the-chart/assignment.md | 6 +- .../04-adding-to-the-chart/check-shell | 4 +- .../04-adding-to-the-chart/solve-shell | 4 +- .../05-releasing-an-update/assignment.md | 10 +- .../05-releasing-an-update/check-shell | 12 +- .../05-releasing-an-update/solve-shell | 6 +- .../06-support-bundle-diagnosis/assignment.md | 4 +- .../06-support-bundle-diagnosis/check-shell | 2 +- .../06-support-bundle-diagnosis/setup-shell | 5 +- .../06-support-bundle-diagnosis/solve-shell | 2 +- .../07-other-ways/assignment.md | 16 +- .../07-other-ways/check-shell | 21 +-- instruqt/closing-information-gap/config.yml | 2 +- instruqt/closing-information-gap/track.yml | 10 +- .../track_scripts/setup-shell | 29 ++-- .../01-preparing-to-use-the-sdk/assignment.md | 4 +- .../01-preparing-to-use-the-sdk/check-shell | 2 +- .../01-preparing-to-use-the-sdk/solve-shell | 2 +- .../02-enabling-the-sdk/assignment.md | 6 +- .../02-enabling-the-sdk/check-shell | 4 +- .../02-enabling-the-sdk/solve-shell | 2 +- .../03-creating-a-release/assignment.md | 10 +- .../03-creating-a-release/check-shell | 12 +- .../03-creating-a-release/solve-shell | 6 +- .../assignment.md | 4 +- .../04-installing-the-application/check-shell | 2 +- .../05-validating-the-install/assignment.md | 2 +- .../distributing-with-replicated/config.yml | 2 +- .../distributing-with-replicated/track.yml | 10 +- setup/pkg/fieldlabs/environment_create.go | 152 +++++++++--------- 49 files changed, 234 insertions(+), 215 deletions(-) create mode 100755 instruqt/closing-information-gap/01-viewing-instance-info/check-shell diff --git a/instruqt/avoiding-installation-pitfalls/01-working-with-preflight-checks/assignment.md b/instruqt/avoiding-installation-pitfalls/01-working-with-preflight-checks/assignment.md index 774e16360..d07621824 100755 --- a/instruqt/avoiding-installation-pitfalls/01-working-with-preflight-checks/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/01-working-with-preflight-checks/assignment.md @@ -1,6 +1,6 @@ --- slug: working-with-preflight-checks -id: hbegc1xc0kld +id: vas7h6ypnrmy type: challenge title: Working with Preflight Checks teaser: |- @@ -16,7 +16,7 @@ tabs: - title: Manifest Editor type: code hostname: shell - path: /home/replicant + path: /home difficulty: basic timelimit: 300 --- diff --git a/instruqt/avoiding-installation-pitfalls/02-checking-cluster-resources/assignment.md b/instruqt/avoiding-installation-pitfalls/02-checking-cluster-resources/assignment.md index d5f811e79..ae70ed283 100755 --- a/instruqt/avoiding-installation-pitfalls/02-checking-cluster-resources/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/02-checking-cluster-resources/assignment.md @@ -1,6 +1,6 @@ --- slug: checking-cluster-resources -id: ghsphablorib +id: fjch1mlffnx4 type: challenge title: Checking Cluster Resources teaser: Use preflight checks to validate minimum cluster requirements diff --git a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/assignment.md b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/assignment.md index b948cc4b1..275b3b16c 100755 --- a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/assignment.md @@ -1,6 +1,6 @@ --- slug: adding-preflights-to-the-chart -id: rey80xsp7n5p +id: lcpwe2dkxmr0 type: challenge title: Adding Preflights to the Harbor Helm Chart teaser: Learn how to incorporate your preflight checks into your chart @@ -228,12 +228,12 @@ helm template harbor | kubectl preflight - ``` If you're satisfied with the tests, bump the version of your Helm chart in the file -`harbor/Chart.yaml` from `16.7.0` to `16.8.0`, then repackage it. You can edit +`harbor/Chart.yaml` from `19.2.0` to `19.3.0`, then repackage it. You can edit the version in the Manifest Editor or run the following command to do it from the shell: ``` -yq -i '.version = "16.8.0"' harbor/Chart.yaml +yq -i '.version = "19.3.0"' harbor/Chart.yaml ``` Then run the `helm package` command to package the updated version: diff --git a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/check-shell b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/check-shell index c382846e5..6fc806e2c 100755 --- a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/check-shell +++ b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/check-shell @@ -44,7 +44,7 @@ if [[ "${fails}" -ne "1" ]] ; then fi # look for the preflight template file -if [[ ! -f /home/replicant/release/harbor-16.8.0.tgz ]] ; then +if [[ ! -f /home/replicant/release/harbor-19.3.0.tgz ]] ; then fail-message $'Please make sure you\'ve bumped the version of your Helm chart and re-packaged it' let "result = result + 1" fi diff --git a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/solve-shell b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/solve-shell index 7b39d1b47..8695877f6 100755 --- a/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/solve-shell +++ b/instruqt/avoiding-installation-pitfalls/03-adding-preflights-to-the-chart/solve-shell @@ -86,6 +86,6 @@ stringData: message: Your cluster has sufficient memory available to run Harbor HARBOR_PREFLIGHTS -yq -i '.version = "16.8.0"' /home/replicant/harbor/Chart.yaml +yq -i '.version = "19.3.0"' /home/replicant/harbor/Chart.yaml helm package /home/replicant/harbor --destination /home/replicant/release chown -R replicant /home/replicant/harbor /home/replicant/release diff --git a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/assignment.md b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/assignment.md index 141369836..8e7d43e21 100755 --- a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/assignment.md @@ -1,6 +1,6 @@ --- slug: releasing-the-application -id: ivm88bvvie5l +id: 5jisluk3n6vr type: challenge title: Releasing the Application teaser: Releasing with preflights on the Replicated Platform @@ -88,11 +88,11 @@ use the `Unstable` channel for this lab, since the latter approach is best for teams working with feature branches. ``` -replicated release create --promote Unstable --yaml-dir ./release --version 16.8.0 \ +replicated release create --promote Unstable --chart ./release/harbor-19.3.0.tgz --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" ``` -This creates a release for version `16.8.0` of the Harbor Helm +This creates a release for version `19.3.0` of the Harbor Helm chart, and promotes it to the `Unstable` channel. The `create` command output a sequence number that you'll need for `promote` (it will be `2` if you haven't explored releasing a bit more). @@ -112,14 +112,14 @@ of those channels---your teams review and approval processes, steps in a continuous delivery pipeline, or both. Run the following command to promote our release to the `Beta` channel: ``` -replicated release promote 2 Beta --version 16.8.0 \ +replicated release promote 2 Beta --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" ``` Then promote to the `Stable` channel: ``` -replicated release promote 2 Stable --version 16.8.0 \ +replicated release promote 2 Stable --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" ``` diff --git a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/check-shell b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/check-shell index 565c5dd98..215889228 100755 --- a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/check-shell +++ b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/check-shell @@ -9,22 +9,22 @@ result=0 # check for release to Unstable api_token=$(get_api_token) unstable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .currentVersion') -if [[ ! "${unstable_version}" == "16.8.0" ]] ; then - fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`16.8.0\`' +if [[ ! "${unstable_version}" == "19.3.0" ]] ; then + fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`19.3.0\`' let "result = result + 1" fi # check for promotion to Beta beta_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Beta" ) | .currentVersion') -if [[ ! "${beta_version}" == "16.8.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`16.8.0\`' +if [[ ! "${beta_version}" == "19.3.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`19.3.0\`' let "result = result + 1" fi # check for promotion to Stable stable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Stable" ) | .currentVersion') -if [[ ! "${stable_version}" == "16.8.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`16.8.0\`' +if [[ ! "${stable_version}" == "19.3.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`19.3.0\`' let "result = result + 1" fi diff --git a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/solve-shell b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/solve-shell index 812c13d0b..c55c96b96 100755 --- a/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/solve-shell +++ b/instruqt/avoiding-installation-pitfalls/04-releasing-the-application/solve-shell @@ -29,7 +29,7 @@ api_token=$(get_api_token) app_slug=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].slug') # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.8.0 \ +replicated release create --promote Unstable --chart ./release/harbor-19.3.0.tgz --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} @@ -37,11 +37,11 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.8.0 \ +replicated release promote ${release_sequence} Beta --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.8.0 \ +replicated release promote ${release_sequence} Stable --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} diff --git a/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/assignment.md b/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/assignment.md index 8570deb28..3ac239667 100755 --- a/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/assignment.md @@ -1,6 +1,6 @@ --- slug: validating-before-an-install -id: agnr2vn44qs0 +id: gyzywxla7qt8 type: challenge title: Validating Before an Install teaser: How your customer uses preflights to validate their environment @@ -44,7 +44,7 @@ Password: `[[ Instruqt-Var key="PASSWORD" hostname="shell" ]]` You'll land on the "Channels" page for your app, which will show the release channels we discussed in the previous step. Notice that -each of the default channels shows the current version `16.8.0`, +each of the default channels shows the current version `19.3.0`, while the channel LTS, which we haven't released to, reflects that. diff --git a/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/solve-shell b/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/solve-shell index 0020fa1f0..ae984be85 100755 --- a/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/solve-shell +++ b/instruqt/avoiding-installation-pitfalls/05-validating-before-an-install/solve-shell @@ -14,7 +14,7 @@ app_slug=$(curl --header 'Accept: application/json' --header "Authorization: ${a customer_email="${INSTRUQT_PARTICIPANT_ID}@geeglo.io" # create the new customer and keep track of the ID -customer_id=$(replicated customer create --name "Geeglo" --email ${customer_email} --channel Stable --expires-in 720h --output json --app ${app_slug} --token ${api_token} | jq -r .id) +customer_id=$(replicated customer create --name "Geeglo" --email ${customer_email} --channel Stable --expires-in 720h --kots-install=false --output json --app ${app_slug} --token ${api_token} | jq -r .id) # make sure the customer has a trial license updated_customer=$(curl --header 'Accept: application/json' --header "Authorization: ${api_token}" "https://api.replicated.com/vendor/v3/app/${app_id}/customer/${customer_id}" | \ diff --git a/instruqt/avoiding-installation-pitfalls/06-completing-the-install/assignment.md b/instruqt/avoiding-installation-pitfalls/06-completing-the-install/assignment.md index 0a856dfdc..e85c52682 100755 --- a/instruqt/avoiding-installation-pitfalls/06-completing-the-install/assignment.md +++ b/instruqt/avoiding-installation-pitfalls/06-completing-the-install/assignment.md @@ -1,6 +1,6 @@ --- slug: completing-the-install -id: aeywtcz1jfwc +id: 3fqiqvosmf7i type: challenge title: Completing the Install teaser: Finishing the install once the cluster passes its preflights diff --git a/instruqt/avoiding-installation-pitfalls/06-completing-the-install/check-shell b/instruqt/avoiding-installation-pitfalls/06-completing-the-install/check-shell index 465543a2f..95f107e97 100755 --- a/instruqt/avoiding-installation-pitfalls/06-completing-the-install/check-shell +++ b/instruqt/avoiding-installation-pitfalls/06-completing-the-install/check-shell @@ -8,7 +8,7 @@ result=0 # check for release to Unstable installed_chart=$(helm list -o yaml --kubeconfig /home/replicant/.kube/config | yq '.[0].chart') -if [[ ! "${installed_chart}" == "harbor-16.8.0" ]] ; then +if [[ ! "${installed_chart}" == "harbor-19.3.0" ]] ; then fail-message 'Please be sure to install the Harbor Helm chart' let "result = result + 1" fi diff --git a/instruqt/avoiding-installation-pitfalls/config.yml b/instruqt/avoiding-installation-pitfalls/config.yml index a43e6936c..9169f57a7 100755 --- a/instruqt/avoiding-installation-pitfalls/config.yml +++ b/instruqt/avoiding-installation-pitfalls/config.yml @@ -1,7 +1,7 @@ version: "3" containers: - name: shell - image: gcr.io/kots-field-labs/shell:feature-helm-preflights + image: gcr.io/kots-field-labs/shell:main shell: tmux new-session -A -s shell su - replicant virtualmachines: - name: cluster diff --git a/instruqt/avoiding-installation-pitfalls/track.yml b/instruqt/avoiding-installation-pitfalls/track.yml index 10984988c..868e8ab24 100755 --- a/instruqt/avoiding-installation-pitfalls/track.yml +++ b/instruqt/avoiding-installation-pitfalls/track.yml @@ -1,5 +1,5 @@ slug: avoiding-installation-pitfalls -id: +id: amjfqroa5bfk title: Avoiding Installation Pitfalls teaser: |- Use Preflight checks to avoid common installation pitfalls @@ -19,16 +19,16 @@ description: |- installing icon: https://storage.googleapis.com/shared-lab-assets/icons/red/checklist.png tags: +- prod - builders-plan -- helm - troubleshoot -- prod +- helm owner: replicated developers: - chuck@replicated.com -maintenance: false lab_config: overlay: false width: 33 position: right -checksum: "18363644782998677466" + enableLoadingMessages: true +checksum: "15041863163879828350" diff --git a/instruqt/avoiding-installation-pitfalls/track_scripts/setup-shell b/instruqt/avoiding-installation-pitfalls/track_scripts/setup-shell index 429f14631..eafc2a22b 100755 --- a/instruqt/avoiding-installation-pitfalls/track_scripts/setup-shell +++ b/instruqt/avoiding-installation-pitfalls/track_scripts/setup-shell @@ -30,9 +30,10 @@ export REPLICATED_API_TOKEN=${api_token} export REPLICATED_APP=${app_slug} cd /home/replicant -mkdir release -helm pull --version 16.6.8 oci://registry-1.docker.io/bitnamicharts/harbor --untar -yq -i '.version = "16.7.0"' harbor/Chart.yaml +mkdir /home/replicant/release + +helm pull --version 19.1.0 oci://registry-1.docker.io/bitnamicharts/harbor --untar +yq -i '.version = "19.2.0"' harbor/Chart.yaml replicated_sdk_version=$(curl -qsfL https://api.github.com/repos/replicatedhq/replicated-sdk/tags | jq -r '.[0] | .name') yq -i ".dependencies += { \"name\": \"replicated\", \"repository\": \"oci://registry.replicated.com/library\", \"version\": \"${replicated_sdk_version#?}\"}" harbor/Chart.yaml @@ -45,7 +46,7 @@ helm package harbor --destination release # release and promote the app # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.7.0 \ +replicated release create --promote Unstable --chart /home/replicant/release/harbor-19.2.0.tgz --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} @@ -53,12 +54,12 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.7.0 \ +replicated release promote ${release_sequence} Beta --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.7.0 \ +replicated release promote ${release_sequence} Stable --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} @@ -67,7 +68,7 @@ replicated channel create --name LTS --description "Releases with long-term supp --app ${app_slug} --token ${api_token} # remove the helm chart we used to create the release -rm /home/replicant/release/harbor-16.7.0.tgz +rm /home/replicant/release/harbor-19.2.0.tgz # make sure permissions are good chown -R replicant /home/replicant/harbor /home/replicant/release diff --git a/instruqt/closing-information-gap/01-viewing-instance-info/assignment.md b/instruqt/closing-information-gap/01-viewing-instance-info/assignment.md index 9012751e2..ba5200ffd 100755 --- a/instruqt/closing-information-gap/01-viewing-instance-info/assignment.md +++ b/instruqt/closing-information-gap/01-viewing-instance-info/assignment.md @@ -1,6 +1,6 @@ --- slug: viewing-instance-info -id: u7arnjksadrw +id: jukpqxmfyyww type: challenge title: Getting a Picture of a Customer Instance teaser: Using the Replicated Platform to understand details of a customer instance diff --git a/instruqt/closing-information-gap/01-viewing-instance-info/check-shell b/instruqt/closing-information-gap/01-viewing-instance-info/check-shell new file mode 100755 index 000000000..8a6b9f5f0 --- /dev/null +++ b/instruqt/closing-information-gap/01-viewing-instance-info/check-shell @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# This set line ensures that all failures will cause the script to error and exit +set -euxo pipefail +exit 0 diff --git a/instruqt/closing-information-gap/02-working-with-support-bundles/assignment.md b/instruqt/closing-information-gap/02-working-with-support-bundles/assignment.md index 59e0191c8..0e0cbeec8 100755 --- a/instruqt/closing-information-gap/02-working-with-support-bundles/assignment.md +++ b/instruqt/closing-information-gap/02-working-with-support-bundles/assignment.md @@ -1,6 +1,6 @@ --- slug: working-with-support-bundles -id: y9cpyp05iq1k +id: toucvosxrmfv type: challenge title: Working with Support Bundles teaser: |- @@ -16,7 +16,7 @@ tabs: - title: Manifest Editor type: code hostname: shell - path: /home/replicant + path: /home difficulty: basic timelimit: 420 --- @@ -58,7 +58,7 @@ spec: ``` You can view the file in the Manifest Editor tab or from the command line. -Let's try colelcting a support bunglde with it.. +Let's try collecting a support bunglde with it. ``` kubectl support-bundle ./simplest-support-bundle.yaml diff --git a/instruqt/closing-information-gap/03-additional-information/assignment.md b/instruqt/closing-information-gap/03-additional-information/assignment.md index 9e1e0c87b..d0dd16942 100755 --- a/instruqt/closing-information-gap/03-additional-information/assignment.md +++ b/instruqt/closing-information-gap/03-additional-information/assignment.md @@ -1,6 +1,6 @@ --- slug: additional-information -id: sxl90k6n2bmz +id: 9nq6zzdmcawq type: challenge title: Collecting and Analyzing Additional Information teaser: | diff --git a/instruqt/closing-information-gap/04-adding-to-the-chart/assignment.md b/instruqt/closing-information-gap/04-adding-to-the-chart/assignment.md index 449501452..8202b170e 100755 --- a/instruqt/closing-information-gap/04-adding-to-the-chart/assignment.md +++ b/instruqt/closing-information-gap/04-adding-to-the-chart/assignment.md @@ -1,6 +1,6 @@ --- slug: adding-to-the-chart -id: vvxrunt3e7zu +id: 5gjk0ex2xofz type: challenge title: Adding the Support Bundle to the Harbor Helm Chart teaser: Learn how to incorporate your support bundle into your chart @@ -129,12 +129,12 @@ Repackaging Your Chart ====================== To distribute your support bundle, you should bump the version number in -`harbor/Chart.yaml` (from `16.8.0` to `16.9.0`) adn then repackage it. You can edit +`harbor/Chart.yaml` (from `19.3.0` to `19.4.0`) adn then repackage it. You can edit the version in the Manifest Editor or run the following command to do it from the shell. ``` -yq -i '.version = "16.9.0"' harbor/Chart.yaml +yq -i '.version = "19.4.0"' harbor/Chart.yaml ``` and run the `helm package` command to package the updated version diff --git a/instruqt/closing-information-gap/04-adding-to-the-chart/check-shell b/instruqt/closing-information-gap/04-adding-to-the-chart/check-shell index 58ef2cfbb..9d01b344e 100755 --- a/instruqt/closing-information-gap/04-adding-to-the-chart/check-shell +++ b/instruqt/closing-information-gap/04-adding-to-the-chart/check-shell @@ -11,11 +11,11 @@ if [[ ! -f /home/replicant/harbor/templates/troubleshoot/support-bundle.yaml ]] let "result = result + 1" fi -if [[ "$(helm template /home/replicant/harbor | yq 'select( .kind == "Secret" ) | select( .metadata.labels."troubleshoot.sh/kind" == "support-bundle" ) | .stringData | has("support-bundle-spec")')" == "true" ]] ; then +if [[ "$(helm template /home/replicant/harbor | yq 'select( .kind == "Secret" ) | select( .metadata.labels."troubleshoot.sh/kind" == "support-bundle" ) | .stringData | has("support-bundle-spec")' | head -1)" == "true" ]] ; then set +e pipefail analyzer_results="$(helm template /home/replicant/harbor | kubectl support-bundle --interactive=false --kubeconfig /home/replicant/.kube/config -)" set -e pipefail else - fail-message 'Please add your preflight checks to the preflights template file' + fail-message 'Please add your support bundle definition to the support bundle template file' let "result = result + 1" fi diff --git a/instruqt/closing-information-gap/04-adding-to-the-chart/solve-shell b/instruqt/closing-information-gap/04-adding-to-the-chart/solve-shell index 7e374668d..46d499520 100755 --- a/instruqt/closing-information-gap/04-adding-to-the-chart/solve-shell +++ b/instruqt/closing-information-gap/04-adding-to-the-chart/solve-shell @@ -3,7 +3,7 @@ # This set line ensures that all failures will cause the script to error and exit set -euxo pipefail -cat < /home/replicant/harbor/templates/support-bundle.yaml +cat < /home/replicant/harbor/templates/troubelshoot/support-bundle.yaml apiVersion: v1 kind: Secret metadata: @@ -221,6 +221,6 @@ stringData: The Trivy image scanner is running on this cluster and ready for use. HARBOR_SUPPORT_BUNDLE -yq -i '.version = "16.9.0"' /home/replicant/harbor/Chart.yaml +yq -i '.version = "19.4.0"' /home/replicant/harbor/Chart.yaml helm package /home/replicant/harbor --destination /home/replicant/release chown -R replicant /home/replicant/harbor /home/replicant/release diff --git a/instruqt/closing-information-gap/05-releasing-an-update/assignment.md b/instruqt/closing-information-gap/05-releasing-an-update/assignment.md index 9f8b55042..9da5b5a75 100755 --- a/instruqt/closing-information-gap/05-releasing-an-update/assignment.md +++ b/instruqt/closing-information-gap/05-releasing-an-update/assignment.md @@ -1,6 +1,6 @@ --- slug: releasing-an-update -id: tnyktndlfuw7 +id: ojdf6ltz8t6t type: challenge title: Releasing an Update with the Support Bundle teaser: Releasing a new version with the support bundle included @@ -72,11 +72,11 @@ default release channels that is generally used internally for releases that may or not be ready for customers. ``` -replicated release create --promote Unstable --yaml-dir ./release --version 16.9.0 \ +replicated release create --promote Unstable --chart ./release/harbor-19.4.0.tgz --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" ``` -This creates a release for version `16.9.0` of the Harbor Helm chart, and +This creates a release for version `19.4.0` of the Harbor Helm chart, and promotes it to the `Unstable` channel. The `create` command output sequence number that you'll need for `promote` (it will be `3` if you haven't explored releasing a bit more). @@ -122,14 +122,14 @@ to determine whether a release should be promoted to each of those channels---hopefully automated as part of your continuous delivery pipelines. ``` -replicated release promote 3 Beta --version 16.9.0 \ +replicated release promote 3 Beta --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" ``` and then ``` -replicated release promote 3 Stable --version 16.9.0 \ +replicated release promote 3 Stable --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" ``` diff --git a/instruqt/closing-information-gap/05-releasing-an-update/check-shell b/instruqt/closing-information-gap/05-releasing-an-update/check-shell index 36bbad2c7..31c10a25f 100755 --- a/instruqt/closing-information-gap/05-releasing-an-update/check-shell +++ b/instruqt/closing-information-gap/05-releasing-an-update/check-shell @@ -9,22 +9,22 @@ result=0 # check for release to Unstable api_token=$(get_api_token) unstable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .currentVersion') -if [[ ! "${unstable_version}" == "16.9.0" ]] ; then - fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`16.9.0\`' +if [[ ! "${unstable_version}" == "19.4.0" ]] ; then + fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`19.4.0\`' let "result = result + 1" fi # check for promotion to Beta beta_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Beta" ) | .currentVersion') -if [[ ! "${beta_version}" == "16.9.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`16.9.0\`' +if [[ ! "${beta_version}" == "19.4.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`19.4.0\`' let "result = result + 1" fi # check for promotion to Stable stable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Stable" ) | .currentVersion') -if [[ ! "${stable_version}" == "16.9.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`16.9.0\`' +if [[ ! "${stable_version}" == "19.4.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`19.4.0\`' let "result = result + 1" fi diff --git a/instruqt/closing-information-gap/05-releasing-an-update/solve-shell b/instruqt/closing-information-gap/05-releasing-an-update/solve-shell index 0f6634bfb..aea4e2661 100755 --- a/instruqt/closing-information-gap/05-releasing-an-update/solve-shell +++ b/instruqt/closing-information-gap/05-releasing-an-update/solve-shell @@ -29,7 +29,7 @@ api_token=$(get_api_token) app_slug=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].slug') # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.9.0 \ +replicated release create --promote Unstable --chart /home/replicant/release/harbor-19.4.0.tgz --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" \ --app ${app_slug} --token ${api_token} @@ -37,11 +37,11 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.9.0 \ +replicated release promote ${release_sequence} Beta --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.9.0 \ +replicated release promote ${release_sequence} Stable --version 19.4.0 \ --release-notes "Adds a support bundle spec to facilitate troubleshooting" \ --app ${app_slug} --token ${api_token} diff --git a/instruqt/closing-information-gap/06-support-bundle-diagnosis/assignment.md b/instruqt/closing-information-gap/06-support-bundle-diagnosis/assignment.md index 37f5e6ce2..6b05445d6 100755 --- a/instruqt/closing-information-gap/06-support-bundle-diagnosis/assignment.md +++ b/instruqt/closing-information-gap/06-support-bundle-diagnosis/assignment.md @@ -1,6 +1,6 @@ --- slug: support-bundle-diagnosis -id: y5uwhsz4tiwj +id: wddwnaxnvkue type: challenge title: Using the Support Bundle to Diagnose the Issue teaser: Discover the cause of Geeglo's outage using a support bundle @@ -42,7 +42,7 @@ their instance. ``` helm upgrade harbor \ - oci://registry.replicated.com/[[ Instruqt-Var key="REPLICATED_APP" hostname="shell" ]]/harbor \ + oci://registry.replicated.com/[[ Instruqt-Var key="REPLICATED_APP" hostname="shell" ]]/harbor ``` Check to see if the support bundle secret has been created. diff --git a/instruqt/closing-information-gap/06-support-bundle-diagnosis/check-shell b/instruqt/closing-information-gap/06-support-bundle-diagnosis/check-shell index a1a345235..ee0db1a14 100755 --- a/instruqt/closing-information-gap/06-support-bundle-diagnosis/check-shell +++ b/instruqt/closing-information-gap/06-support-bundle-diagnosis/check-shell @@ -9,7 +9,7 @@ result=0 # check for installation of the updated chart installed_chart=$(helm list -o yaml --kubeconfig /home/replicant/.kube/config | yq '.[0].chart') -if [[ ! "${installed_chart}" == "harbor-16.9.0" ]] ; then +if [[ ! "${installed_chart}" == "harbor-19.4.0" ]] ; then fail-message $'Please be sure to upgrade the customer\'s instance to the verison including your support bundle' let "result = result + 1" fi diff --git a/instruqt/closing-information-gap/06-support-bundle-diagnosis/setup-shell b/instruqt/closing-information-gap/06-support-bundle-diagnosis/setup-shell index 8d4a8e2b1..c2001afac 100755 --- a/instruqt/closing-information-gap/06-support-bundle-diagnosis/setup-shell +++ b/instruqt/closing-information-gap/06-support-bundle-diagnosis/setup-shell @@ -24,8 +24,11 @@ api_token=$(get_api_token) customer_email="${INSTRUQT_PARTICIPANT_ID}@geeglo.io" # get the registry password (which is the license id) +app_id=$(curl --header 'Accept: application/json' --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].id') +app_slug=$(curl --header 'Accept: application/json' --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].slug') +customer_id=$(replicated customer ls --output json --app "${app_slug}" --token "${api_token}" | jq -r '.[] | select ( .name == "Geeglo" ) | .id') registry_password=$(curl --header 'Accept: application/json' --header "Authorization: ${api_token}" "https://api.replicated.com/vendor/v3/app/${app_id}/customer/${customer_id}" | \ yq .customer.installationId) agent variable set CUSTOMER_EMAIL ${customer_email} -agent variable set REGISTRY_PASSWORD ${registry_pasword} +agent variable set REGISTRY_PASSWORD ${registry_password} diff --git a/instruqt/closing-information-gap/06-support-bundle-diagnosis/solve-shell b/instruqt/closing-information-gap/06-support-bundle-diagnosis/solve-shell index c1d32eb7a..8c248f436 100755 --- a/instruqt/closing-information-gap/06-support-bundle-diagnosis/solve-shell +++ b/instruqt/closing-information-gap/06-support-bundle-diagnosis/solve-shell @@ -30,5 +30,5 @@ helm registry login registry.replicated.com \ # upgrade the application app_slug=$(agent variable get REPLICATED_APP) -helm upgrade harbor --version 16.9.0 \ +helm upgrade harbor --version 19.4.0 \ oci://registry.replicated.com/${app_slug}/harbor \ diff --git a/instruqt/closing-information-gap/07-other-ways/assignment.md b/instruqt/closing-information-gap/07-other-ways/assignment.md index 4b27dc08c..c4d7dbdc4 100755 --- a/instruqt/closing-information-gap/07-other-ways/assignment.md +++ b/instruqt/closing-information-gap/07-other-ways/assignment.md @@ -1,6 +1,6 @@ --- slug: other-ways -id: dfec8ytv6wmo +id: sr80rrntbsgo type: challenge title: Other Ways to Offer a Support Bundle teaser: Explore other ways to distibute your support bundle and keep it up to date @@ -67,15 +67,15 @@ Don't forget to the save the file. ![Adding a URI to the Support Bundle spec](../assets/adding-a-uri-to-the-spec.png) -You should also bump the version number for the release to `16.9.1` in the +You should also bump the version number for the release to `19.4.1` in the `Chart.yaml` file, repackage your chart, and delete the old tarball from your release directory. The following commands will take care of that for you. ``` -yq -i '.version = "16.9.1"' harbor/Chart.yaml +yq -i '.version = "19.4.1"' harbor/Chart.yaml helm package harbor --destination ./release -rm ./release/harbor-16.9.0.tgz +rm ./release/harbor-19.4.0.tgz ``` Now you need to release your update and promote it. Remember that for a real @@ -84,11 +84,11 @@ release sequence will be `5` unless you've played around with additional releases. If you have, use the current sequence. ``` -replicated release create --promote Unstable --yaml-dir ./release --version 16.9.1 \ +replicated release create --promote Unstable --chart ./release/harbor-19.4.1.tgz --version 19.4.1 \ --release-notes "Provides the ability to upgrade the support bundle independent of the application" -replicated release promote 5 Beta --version 16.9.1 \ +replicated release promote 4 Beta --version 19.4.1 \ --release-notes "Provides the ability to upgrade the support bundle independent of the application" -replicated release promote 5 Stable --version 16.9.1 \ +replicated release promote 4 Stable --version 19.4.1 \ --release-notes "Provides the ability to upgrade the support bundle independent of the application" ``` @@ -100,6 +100,8 @@ new support bundle containing a reference to your independently released bundle. ``` +helm upgrade harbor \ + oci://registry.replicated.com/[[ Instruqt-Var key="REPLICATED_APP" hostname="shell" ]]/harbor kubectl support-bundle --load-cluster-specs ``` diff --git a/instruqt/closing-information-gap/07-other-ways/check-shell b/instruqt/closing-information-gap/07-other-ways/check-shell index 382d217bb..aa7ab5117 100755 --- a/instruqt/closing-information-gap/07-other-ways/check-shell +++ b/instruqt/closing-information-gap/07-other-ways/check-shell @@ -3,39 +3,42 @@ # This set line ensures that all failures will cause the script to error and exit set -euxo pipefail +# convenience library for Replicated lab lifecycle scripts +source /etc/profile.d/header.sh + result=0 # check whether the URI has been added to the spec -uri_added=$(yq '.spec.has("uri")') -if [[ "${uri_added}" ]] ; then +uri_added=$(helm template /home/replicant/harbor | yq 'select( .kind == "Secret" ) | select( .metadata.labels."troubleshoot.sh/kind" == "support-bundle" ) | .stringData.support-bundle-spec | from_yaml | select ( .metadata.name == "harbor-support-bundle" ) | .spec | has("uri")') +if [[ "${uri_added}" != "true" ]] ; then fail-message 'Please check your support bundle definition to make sure you added the uri for the updated bundle' let "result = result + 1" fi # check for release to Unstable api_token=$(get_api_token) unstable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .currentVersion') -if [[ ! "${unstable_version}" == "16.9.1" ]] ; then - fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`16.9.1\`' +if [[ ! "${unstable_version}" == "19.4.1" ]] ; then + fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`19.4.1\`' let "result = result + 1" fi # check for promotion to Beta beta_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Beta" ) | .currentVersion') -if [[ ! "${beta_version}" == "16.9.1" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`16.9.1\`' +if [[ ! "${beta_version}" == "19.4.1" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`19.4.1\`' let "result = result + 1" fi # check for promotion to Stable stable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Stable" ) | .currentVersion') -if [[ ! "${stable_version}" == "16.9.1" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`16.9.1\`' +if [[ ! "${stable_version}" == "19.4.1" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`19.4.1\`' let "result = result + 1" fi # check that the upgraade chart is installed installed_chart=$(helm list -o yaml --kubeconfig /home/replicant/.kube/config | yq '.[0].chart') -if [[ ! "${installed_chart}" == "harbor-16.9.1" ]] ; then +if [[ ! "${installed_chart}" == "harbor-19.4.1" ]] ; then fail-message $'Please be sure to upgrade the customer\'s instance to the verison including your updated support bundle' let "result = result + 1" fi diff --git a/instruqt/closing-information-gap/config.yml b/instruqt/closing-information-gap/config.yml index 610c1babe..9389728fe 100755 --- a/instruqt/closing-information-gap/config.yml +++ b/instruqt/closing-information-gap/config.yml @@ -1,7 +1,7 @@ version: "3" containers: - name: shell - image: gcr.io/kots-field-labs/shell:latest + image: gcr.io/kots-field-labs/shell:main shell: tmux new-session -A -s shell su - replicant virtualmachines: - name: cluster diff --git a/instruqt/closing-information-gap/track.yml b/instruqt/closing-information-gap/track.yml index 19fb2072e..299752aac 100755 --- a/instruqt/closing-information-gap/track.yml +++ b/instruqt/closing-information-gap/track.yml @@ -1,5 +1,5 @@ slug: closing-information-gap -id: +id: hfb41xqkyx0q title: Closing the Support Information Gap teaser: |- Use the Replicated Platform to close the information gap between your @@ -19,16 +19,16 @@ description: |- issue multiple times icon: https://storage.googleapis.com/shared-lab-assets/icons/red/audit_log.png tags: +- prod - builders-plan -- helm - troubleshoot -- prod +- helm owner: replicated developers: - chuck@replicated.com -maintenance: false lab_config: overlay: false width: 33 position: right -checksum: "8657597645467563973" + enableLoadingMessages: true +checksum: "16018974617273983350" diff --git a/instruqt/closing-information-gap/track_scripts/setup-shell b/instruqt/closing-information-gap/track_scripts/setup-shell index 031a46f97..cbcc0ea30 100755 --- a/instruqt/closing-information-gap/track_scripts/setup-shell +++ b/instruqt/closing-information-gap/track_scripts/setup-shell @@ -33,9 +33,10 @@ export REPLICATED_APP=${app_slug} ## release the application with the Replicated SDK cd /home/replicant -mkdir release -helm pull --version 16.6.8 oci://registry-1.docker.io/bitnamicharts/harbor --untar -yq -i '.version = "16.7.0"' harbor/Chart.yaml +mkdir /home/replicant/release + +helm pull --version 19.1.0 oci://registry-1.docker.io/bitnamicharts/harbor --untar +yq -i '.version = "19.2.0"' harbor/Chart.yaml replicated_sdk_version=$(curl -qsfL https://api.github.com/repos/replicatedhq/replicated-sdk/tags | jq -r '.[0] | .name') yq -i ".dependencies += { \"name\": \"replicated\", \"repository\": \"oci://registry.replicated.com/library\", \"version\": \"${replicated_sdk_version#?}\"}" harbor/Chart.yaml @@ -48,7 +49,7 @@ helm package harbor --destination release ## release and promote the app with the SDK added # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.7.0 \ +replicated release create --promote Unstable --chart /home/replicant/release/harbor-19.2.0.tgz --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} @@ -56,12 +57,12 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.7.0 \ +replicated release promote ${release_sequence} Beta --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.7.0 \ +replicated release promote ${release_sequence} Stable --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} @@ -70,7 +71,7 @@ replicated channel create --name LTS --description "Releases with long-term supp --app ${app_slug} --token ${api_token} # remove the helm chart we used to create the release -rm /home/replicant/release/harbor-16.7.0.tgz +rm /home/replicant/release/harbor-19.2.0.tgz ## release the application with the Replicated SDK # add preflight checks to the Helm chart @@ -158,14 +159,14 @@ stringData: HARBOR_PREFLIGHTS # bump the version -yq -i '.version = "16.8.0"' /home/replicant/harbor/Chart.yaml +yq -i '.version = "19.3.0"' /home/replicant/harbor/Chart.yaml helm package /home/replicant/harbor --destination /home/replicant/release chown -R replicant /home/replicant/harbor /home/replicant/release ## release and promote the preflight checks added # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.8.0 \ +replicated release create --promote Unstable --chart /home/replicant/release/harbor-19.3.0.tgz --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} @@ -173,17 +174,17 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.8.0 \ +replicated release promote ${release_sequence} Beta --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.8.0 \ +replicated release promote ${release_sequence} Stable --version 19.3.0 \ --release-notes "Adds preflight checks to enable customers to validate cluster prerequisites before installing" \ --app ${app_slug} --token ${api_token} # remove the helm chart we used to create the release -rm /home/replicant/release/harbor-16.8.0.tgz +rm /home/replicant/release/harbor-19.3.0.tgz ## create the customer from the preflights lab @@ -191,7 +192,7 @@ rm /home/replicant/release/harbor-16.8.0.tgz customer_email="${INSTRUQT_PARTICIPANT_ID}@geeglo.io" # create the new customer and keep track of the ID -customer_id=$(replicated customer create --name "Geeglo" --email ${customer_email} --channel Stable --expires-in 720h --output json --app ${app_slug} --token ${api_token} | jq -r .id) +customer_id=$(replicated customer create --name "Geeglo" --email ${customer_email} --channel Stable --expires-in 720h --kots-install=false --output json --app ${app_slug} --token ${api_token} | jq -r .id) # make sure the customer has a trial license updated_customer=$(curl --header 'Accept: application/json' --header "Authorization: ${api_token}" "https://api.replicated.com/vendor/v3/app/${app_id}/customer/${customer_id}" | \ @@ -216,7 +217,7 @@ helm registry login registry.replicated.com \ # install the application, trying again if it fails since there might be timing issues set +e retries=0 -while ! helm install harbor --version 16.8.0 \ +while ! helm install harbor --version 19.3.0 \ oci://registry.replicated.com/${app_slug}/harbor \ --set service.type=NodePort --set service.nodePort.https=30443 \ --set externalURL=https://cluster-30443-${INSTRUQT_PARTICIPANT_ID}.env.play.instruqt.com \ diff --git a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/assignment.md b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/assignment.md index 7dcf63cfb..1c5321194 100755 --- a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/assignment.md +++ b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/assignment.md @@ -1,6 +1,6 @@ --- slug: preparing-to-use-the-sdk -id: nyq00jogbv0q +id: mneddevjccio type: challenge title: Preparing to Use the SDK teaser: Getting ready to use the Replicated SDK @@ -54,7 +54,7 @@ Helm chart. Let's pull down the chart so that we can get started. ```bash -helm pull --version 16.6.8 oci://registry-1.docker.io/bitnamicharts/harbor --untar +helm pull --version 19.1.0 oci://registry-1.docker.io/bitnamicharts/harbor --untar ``` Let's also set up our shell for interacting with the Replicated diff --git a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/check-shell b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/check-shell index 68e68db93..2a5fb8e93 100755 --- a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/check-shell +++ b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/check-shell @@ -9,7 +9,7 @@ SESSION=$(tmux save-buffer -) # check for disconnection result=0 -if ! grep -qE 'REPLICATED_API_TOKEN=[A-Za-z "]+' <(echo ${SESSION}) ; then +if ! grep -qE 'REPLICATED_API_TOKEN=[A-Za-z0-9 "]+' <(echo ${SESSION}) ; then fail-message 'Please set the variable `$REPLICATED_API_TOKEN` so you will be able to use the `replicated` command in future steps' let "result = result + 1" fi diff --git a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/solve-shell b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/solve-shell index 42ecd6dc7..ca4b481ef 100755 --- a/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/solve-shell +++ b/instruqt/distributing-with-replicated/01-preparing-to-use-the-sdk/solve-shell @@ -17,4 +17,4 @@ fi tmux send-keys -t shell export SPACE 'REPLICATED_API_TOKEN=' "$(agent variable get REPLICATED_API_TOKEN)" ENTER tmux send-keys -t shell export SPACE 'REPLICATED_APP=' "$(agent variable get REPLICATED_APP)" ENTER -tmux send-keys -t shell 'helm pull --version 16.6.8 oci://registry-1.docker.io/bitnamicharts/harbor --untar' ENTER +tmux send-keys -t shell 'helm pull --version 19.1.0 oci://registry-1.docker.io/bitnamicharts/harbor --untar' ENTER diff --git a/instruqt/distributing-with-replicated/02-enabling-the-sdk/assignment.md b/instruqt/distributing-with-replicated/02-enabling-the-sdk/assignment.md index fcf16e5c5..5a38c284a 100755 --- a/instruqt/distributing-with-replicated/02-enabling-the-sdk/assignment.md +++ b/instruqt/distributing-with-replicated/02-enabling-the-sdk/assignment.md @@ -1,6 +1,6 @@ --- slug: enabling-the-sdk -id: wy7eklcxxw6c +id: pzlc29lz2h9y type: challenge title: Enabling the Replicated SDK teaser: Incorporate the SDK into your application @@ -63,7 +63,7 @@ a fairly large change. It's not a breaking change, though, so let's just bump the minor version number. ``` -version: 16.7.0 +version: 19.2.0 ``` ![Bumping the Chart Version](../assets/bumping-the-version.png) @@ -101,5 +101,5 @@ ls release which shows ``` -harbor-16.7.0.tgz +harbor-19.2.0.tgz ``` diff --git a/instruqt/distributing-with-replicated/02-enabling-the-sdk/check-shell b/instruqt/distributing-with-replicated/02-enabling-the-sdk/check-shell index 8d894bfc1..947259354 100755 --- a/instruqt/distributing-with-replicated/02-enabling-the-sdk/check-shell +++ b/instruqt/distributing-with-replicated/02-enabling-the-sdk/check-shell @@ -5,7 +5,7 @@ set -euxo pipefail result=0 # check for an updated version number -if [[ "$(yq .version mastodon/Chart.yaml)" == "16.7.0" ]] ; then +if [[ "$(yq .version mastodon/Chart.yaml)" == "19.2.0" ]] ; then fail-message 'Please be sure to update the version of the Mastodon Helm chart to reflect your changes' let "result = result + 1" fi @@ -23,7 +23,7 @@ if [[ "$(yq '.dependencies[] | select ( .name == "replicated" ) | .name')" == " fi # check for the repackaged Helm chart -if [[ ! -f /home/replicant/release/harbor-16.7.0.tgz ]] ; then +if [[ ! -f /home/replicant/release/harbor-19.2.0.tgz ]] ; then fail-message 'Please be sure to update and repackage the Harbor Helm chart' let "result = result + 1" fi diff --git a/instruqt/distributing-with-replicated/02-enabling-the-sdk/solve-shell b/instruqt/distributing-with-replicated/02-enabling-the-sdk/solve-shell index 401832fcc..e2dab0f23 100755 --- a/instruqt/distributing-with-replicated/02-enabling-the-sdk/solve-shell +++ b/instruqt/distributing-with-replicated/02-enabling-the-sdk/solve-shell @@ -16,7 +16,7 @@ if ! tmux has-session -t shell ; then fi # updat the chart version -tmux send-keys -t shell $'yq -i \'.version = "16.7.0"\' harbor/Chart.yaml' ENTER +tmux send-keys -t shell $'yq -i \'.version = "19.2.0"\' harbor/Chart.yaml' ENTER # add the SDK dependency tmux send-keys -t shell "yq -i '.dependencies += { \"name\": \"replicated\", \"repository\": \"oci://registry.replicated.com/library\", \"version\": \"$(agent variable get REPLICATED_SDK_VERSION)\"}' harbor/Chart.yaml" ENTER diff --git a/instruqt/distributing-with-replicated/03-creating-a-release/assignment.md b/instruqt/distributing-with-replicated/03-creating-a-release/assignment.md index c2e6d3329..d594ef3d4 100755 --- a/instruqt/distributing-with-replicated/03-creating-a-release/assignment.md +++ b/instruqt/distributing-with-replicated/03-creating-a-release/assignment.md @@ -1,6 +1,6 @@ --- slug: creating-a-release -id: tbxasfcudqc1 +id: qwjuyn8lmauy type: challenge title: Releasing an Application teaser: Creating a release on the Replicated Platform @@ -85,11 +85,11 @@ To create a release, run the following command. We're using the `Unstable` channel since we're releasing our most recent change. ``` -replicated release create --promote Unstable --yaml-dir ./release --version 16.7.0 \ +replicated release create --promote Unstable --chart ./release/harbor-19.2.0.tgz --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" ``` -This creates a release for version `16.7.0` of your Harbor Helm +This creates a release for version `19.2.0` of your Harbor Helm chart, and promotes it to the `Unstable` channel. The `create` command output a sequence number that you'll need for `promote` (it will be `1` if you haven't explored releasing a bit more). @@ -127,14 +127,14 @@ promoting to `Beta`, and ultimately releasing on `Stable`. For the purposes of the lab, let's just promote the release straight through. ``` -replicated release promote 1 Beta --version 16.7.0 \ +replicated release promote 1 Beta --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" ``` and then ``` -replicated release promote 1 Stable --version 16.7.0 \ +replicated release promote 1 Stable --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" ``` diff --git a/instruqt/distributing-with-replicated/03-creating-a-release/check-shell b/instruqt/distributing-with-replicated/03-creating-a-release/check-shell index 224237871..597b2d25d 100755 --- a/instruqt/distributing-with-replicated/03-creating-a-release/check-shell +++ b/instruqt/distributing-with-replicated/03-creating-a-release/check-shell @@ -17,22 +17,22 @@ fi # check for release to Unstable unstable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .currentVersion') -if [[ ! "${unstable_version}" == "16.7.0" ]] ; then - fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`16.7.0\`' +if [[ ! "${unstable_version}" == "19.2.0" ]] ; then + fail-message $'Please be sure to release the applicaton to the \`Unstable\` channel with version \`19.2.0\`' let "result = result + 1" fi # check for promotion to Beta beta_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Beta" ) | .currentVersion') -if [[ ! "${beta_version}" == "16.7.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`16.7.0\`' +if [[ ! "${beta_version}" == "19.2.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Beta\` channel with version \`19.2.0\`' let "result = result + 1" fi # check for promotion to Stable stable_version=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Stable" ) | .currentVersion') -if [[ ! "${stable_version}" == "16.7.0" ]] ; then - fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`16.7.0\`' +if [[ ! "${stable_version}" == "19.2.0" ]] ; then + fail-message $'Please be sure to promote the applicaton to the \`Stable\` channel with version \`19.2.0\`' let "result = result + 1" fi diff --git a/instruqt/distributing-with-replicated/03-creating-a-release/solve-shell b/instruqt/distributing-with-replicated/03-creating-a-release/solve-shell index d0400ea39..3e8d8a750 100755 --- a/instruqt/distributing-with-replicated/03-creating-a-release/solve-shell +++ b/instruqt/distributing-with-replicated/03-creating-a-release/solve-shell @@ -21,7 +21,7 @@ replicated channel create --name LTS --description "Releases with long-term supp --app ${app_slug} --token ${api_token} # release to the `Unstable` channel -replicated release create --promote Unstable --yaml-dir /home/replicant/release --version 16.7.0 \ +replicated release create --promote Unstable --chart ./release/harbor-19.2.0/tgz --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} @@ -29,11 +29,11 @@ replicated release create --promote Unstable --yaml-dir /home/replicant/release release_sequence=$(curl --header "Accept: application/json" --header "Authorization: ${api_token}" https://api.replicated.com/vendor/v3/apps | jq -r '.apps[0].channels[] | select( .name == "Unstable" ) | .releaseSequence') # promote to the `Beta` channel -replicated release promote ${release_sequence} Beta --version 16.7.0 \ +replicated release promote ${release_sequence} Beta --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} # promote to the `Stable` channel -replicated release promote ${release_sequence} Stable --version 16.7.0 \ +replicated release promote ${release_sequence} Stable --version 19.2.0 \ --release-notes "Prepares for distribution with Replicated by incorporating the Replicated SDK" \ --app ${app_slug} --token ${api_token} diff --git a/instruqt/distributing-with-replicated/04-installing-the-application/assignment.md b/instruqt/distributing-with-replicated/04-installing-the-application/assignment.md index 4064b9f91..2b2a01d7c 100755 --- a/instruqt/distributing-with-replicated/04-installing-the-application/assignment.md +++ b/instruqt/distributing-with-replicated/04-installing-the-application/assignment.md @@ -1,6 +1,6 @@ --- slug: installing-the-application -id: le06dzuzl81y +id: 0jr3scssmdfw type: challenge title: Installing the Application teaser: Let's install the application as your customer @@ -42,7 +42,7 @@ Password: `[[ Instruqt-Var key="PASSWORD" hostname="shell" ]]` You'll land on the "Channels" page for your app, which will show the release channels we discussed in the previous step. Notice that -each channel shows the current version `16.7.0` while the channel LTS, which we haven't released to, reflects +each channel shows the current version `19.2.0` while the channel LTS, which we haven't released to, reflects that. ![Vendor Portal Release Channels](../assets/vendor-portal-landing.png) diff --git a/instruqt/distributing-with-replicated/04-installing-the-application/check-shell b/instruqt/distributing-with-replicated/04-installing-the-application/check-shell index 5f402df12..1b0c20b0d 100755 --- a/instruqt/distributing-with-replicated/04-installing-the-application/check-shell +++ b/instruqt/distributing-with-replicated/04-installing-the-application/check-shell @@ -8,7 +8,7 @@ result=0 # check for release to Unstable installed_chart=$(helm list -o yaml --kubeconfig /home/replicant/.kube/config | yq '.[0].chart') -if [[ ! "${installed_chart}" == "harbor-16.7.0" ]] ; then +if [[ ! "${installed_chart}" == "harbor-19.2.0" ]] ; then fail-message 'Please be sure to install the Harbor Helm chart' let "result = result + 1" fi diff --git a/instruqt/distributing-with-replicated/05-validating-the-install/assignment.md b/instruqt/distributing-with-replicated/05-validating-the-install/assignment.md index 0f0552572..7e22a6e6f 100755 --- a/instruqt/distributing-with-replicated/05-validating-the-install/assignment.md +++ b/instruqt/distributing-with-replicated/05-validating-the-install/assignment.md @@ -1,6 +1,6 @@ --- slug: validating-the-install -id: dwuqvl8c7wrr +id: vtvk2dkrwklo type: challenge title: Observing the Customer Instance teaser: Observing your customer install diff --git a/instruqt/distributing-with-replicated/config.yml b/instruqt/distributing-with-replicated/config.yml index b90798228..c6dda5095 100755 --- a/instruqt/distributing-with-replicated/config.yml +++ b/instruqt/distributing-with-replicated/config.yml @@ -1,7 +1,7 @@ version: "3" containers: - name: shell - image: gcr.io/kots-field-labs/shell:instruqt-feature-tmux-template + image: gcr.io/kots-field-labs/shell:main shell: tmux new-session -A -s shell su - replicant virtualmachines: - name: cluster diff --git a/instruqt/distributing-with-replicated/track.yml b/instruqt/distributing-with-replicated/track.yml index 7cdebb22a..b287090a6 100755 --- a/instruqt/distributing-with-replicated/track.yml +++ b/instruqt/distributing-with-replicated/track.yml @@ -1,5 +1,5 @@ slug: distributing-with-replicated -id: +id: evmpzv6ycpgs title: Distributing Your Application with Replicated description: |- Learn how to quickly take advantage of the Replicated Platform for @@ -14,16 +14,16 @@ description: |- icon: https://storage.googleapis.com/shared-lab-assets/icons/red/appslug.png level: beginner tags: +- prod - builders-plan -- sdk - helm -- prod +- sdk owner: replicated developers: - chuck@replicated.com -maintenance: false lab_config: overlay: false width: 33 position: right -checksum: "11868235989270449838" + enableLoadingMessages: true +checksum: "10082946159492732371" diff --git a/setup/pkg/fieldlabs/environment_create.go b/setup/pkg/fieldlabs/environment_create.go index a37f5672c..0b6066050 100644 --- a/setup/pkg/fieldlabs/environment_create.go +++ b/setup/pkg/fieldlabs/environment_create.go @@ -119,81 +119,85 @@ func (e *EnvironmentManager) createVendorTrack(app types.App, trackSpec TrackSpe appTrackSlug := fmt.Sprintf("%s-%s", app.Slug, track.Spec.Slug) e.Log.ActionWithSpinner("Provision track %s", appTrackSlug) - // load yaml for releases first to ensure directories exist - kotsYAML, err := readYAMLDir(fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) - if err != nil { - return errors.Wrapf(err, "read yaml dir %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) - } - - for _, extraRelease := range track.Spec.ExtraReleases { - kotsYAML, err := readYAMLDir(fmt.Sprintf("%s/%s", e.VendorLoc, extraRelease.YAMLDir)) - if err != nil { - return errors.Wrapf(err, "read yaml dir %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) - } - track.Status.ExtraReleases = append(track.Status.ExtraReleases, ExtraReleaseStatus{ - Spec: extraRelease, - YAML: kotsYAML, - }) - - } - - channel, err := e.getChannel(track) - if err != nil { - return errors.Wrapf(err, "get Stable channel") - } - track.Status.Channel = channel - - if trackSpec.Customer != "" { - customer, err := e.getOrCreateCustomer(track) - if err != nil { - return errors.Wrapf(err, "create customer for track %q app %q", trackSpec.Slug, app.Slug) - } - track.Status.Customer = customer - } - - release, err := e.Client.CreateRelease(app.ID, kotsYAML) - if err != nil { - return errors.Wrapf(err, "create release for %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) - } - - track.Status.Release = release - - err = e.Client.PromoteRelease(app.ID, release.Sequence, "0.1.0", trackSpec.Slug, false, channel.ID) - if err != nil { - return errors.Wrapf(err, "promote release %d to channel %q", release.Sequence, channel.Slug) - } - - for _, extraRelease := range track.Status.ExtraReleases { - releaseInfo, err := e.Client.CreateRelease(app.ID, extraRelease.YAML) - if err != nil { - return errors.Wrapf(err, "create release for %q", fmt.Sprintf("%s/%s", e.VendorLoc, extraRelease.Spec.YAMLDir)) - } - extraRelease.Release = releaseInfo - - if extraRelease.Spec.PromoteChannel != "" { - - continue - } - } - - if trackSpec.K8sInstallerYAMLPath != "" { - kurlYAML, err := ioutil.ReadFile(fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) - if err != nil { - return errors.Wrapf(err, "read installer yaml %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) - } - - installer, err := e.Client.CreateInstaller(app.ID, string(kurlYAML)) - if err != nil { - return errors.Wrapf(err, "create installer from %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) - } - track.Status.Installer = installer - - err = e.Client.PromoteInstaller(app.ID, installer.Sequence, channel.ID, trackSpec.Slug) - if err != nil { - return errors.Wrapf(err, "promote installer %d to channel %q", installer.Sequence, channel.Slug) - } - } + // get the stable channel to assign for customer + channel, err := e.getChannel(track) + if err != nil { + return errors.Wrapf(err, "get Stable channel") + } + track.Status.Channel = channel + + // Create customer + if trackSpec.Customer != "" { + customer, err := e.getOrCreateCustomer(track) + if err != nil { + return errors.Wrapf(err, "create customer for track %q app %q", trackSpec.Slug, app.Slug) + } + track.Status.Customer = customer + } + // load yaml for releases first to ensure directories exist + if trackSpec.YAMLDir != "" { + kotsYAML, err := readYAMLDir(fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) + + if err != nil { + return errors.Wrapf(err, "read yaml dir %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) + } + + for _, extraRelease := range track.Spec.ExtraReleases { + kotsYAML, err := readYAMLDir(fmt.Sprintf("%s/%s", e.VendorLoc, extraRelease.YAMLDir)) + if err != nil { + return errors.Wrapf(err, "read yaml dir %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) + } + track.Status.ExtraReleases = append(track.Status.ExtraReleases, ExtraReleaseStatus{ + Spec: extraRelease, + YAML: kotsYAML, + }) + + } + + release, err := e.Client.CreateRelease(app.ID, kotsYAML) + if err != nil { + return errors.Wrapf(err, "create release for %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.YAMLDir)) + } + + track.Status.Release = release + + err = e.Client.PromoteRelease(app.ID, release.Sequence, "0.1.0", trackSpec.Slug, false, channel.ID) + if err != nil { + return errors.Wrapf(err, "promote release %d to channel %q", release.Sequence, channel.Slug) + } + + for _, extraRelease := range track.Status.ExtraReleases { + releaseInfo, err := e.Client.CreateRelease(app.ID, extraRelease.YAML) + if err != nil { + return errors.Wrapf(err, "create release for %q", fmt.Sprintf("%s/%s", e.VendorLoc, extraRelease.Spec.YAMLDir)) + } + extraRelease.Release = releaseInfo + + if extraRelease.Spec.PromoteChannel != "" { + + continue + } + } + + if trackSpec.K8sInstallerYAMLPath != "" { + kurlYAML, err := ioutil.ReadFile(fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) + if err != nil { + return errors.Wrapf(err, "read installer yaml %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) + } + + installer, err := e.Client.CreateInstaller(app.ID, string(kurlYAML)) + if err != nil { + return errors.Wrapf(err, "create installer from %q", fmt.Sprintf("%s/%s", e.VendorLoc, trackSpec.K8sInstallerYAMLPath)) + } + track.Status.Installer = installer + + err = e.Client.PromoteInstaller(app.ID, installer.Sequence, channel.ID, trackSpec.Slug) + if err != nil { + return errors.Wrapf(err, "promote installer %d to channel %q", installer.Sequence, channel.Slug) + } + } + } return nil }