Skip to content

Commit

Permalink
fix: update example; write manifests to /tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <[email protected]>
  • Loading branch information
TylerGillson committed Sep 19, 2024
1 parent d56f3c1 commit 6d217b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export EARTHLY_BUILDKIT_CACHE_SIZE_MB=500000
export OCI_REGISTRY=${OCI_REGISTRY:-ttl.sh}
export STYLUS_BRANCH=${STYLUS_BRANCH:-2-node}
export PROVIDER_K3S_BRANCH=${PROVIDER_K3S_BRANCH:-two-node}
export PE_VERSION=4.4.12

# two node vars
export TWO_NODE_BACKEND=postgres
10 changes: 4 additions & 6 deletions test/test-two-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,15 @@ function prepare_cluster_profile() {
.spec.template.packs[0].values |= gsub("PE_VERSION"; env.PE_VERSION) |
.spec.template.packs[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) |
.spec.template.packs[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH)
' test/templates/two-node-cluster-profile.json.tmpl > two-node-cluster-profile.json
' test/templates/two-node-cluster-profile.json.tmpl > /tmp/two-node-cluster-profile.json
}

function create_cluster_profile() {
export CLUSTER_PROFILE_UID=$(curl -s -X POST https://$DOMAIN/v1/clusterprofiles/import?publish=true \
-H "ApiKey: $API_KEY" \
-H "Content-Type: application/json" \
-H "ProjectUid: $PROJECT_UID" \
-d @two-node-cluster-profile.json | jq -r .uid)
rm -f two-node-cluster-profile.json
-d @/tmp/two-node-cluster-profile.json | jq -r .uid)
if [ "$CLUSTER_PROFILE_UID" = "null" ]; then
echo Cluster Profile creation failed as it already exists. Please delete it and retry.
return 1
Expand Down Expand Up @@ -386,20 +385,19 @@ function prepare_master_master_cluster() {
.spec.profiles[0].packValues[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) |
.spec.profiles[0].packValues[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) |
.spec.profiles[0].packValues[1].tag = env.K8S_VERSION
' test/templates/two-node-master-master.json.tmpl > two-node-create.json
' test/templates/two-node-master-master.json.tmpl > /tmp/two-node-create.json
}

function create_cluster() {
uid=$(curl -s -X POST https://$DOMAIN/v1/spectroclusters/edge-native?ProjectUid=$PROJECT_UID \
-H "ApiKey: $API_KEY" \
-H "Content-Type: application/json" \
-H "ProjectUid: $PROJECT_UID" \
-d @two-node-create.json | jq -r .uid)
-d @/tmp/two-node-create.json | jq -r .uid)
if [ "$uid" = "null" ]; then
echo "Cluster creation failed. Please check two-node-create.json and retry creation manually to see Hubble's response."
return 1
else
rm -f two-node-create.json
echo "Cluster $uid created"
fi
}
Expand Down

0 comments on commit 6d217b4

Please sign in to comment.