From dc6bf127c7da29f3a49a3e7cca9a2ec4c69fd43d Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Wed, 10 Jan 2024 13:31:01 -0500 Subject: [PATCH] fix: parameterize k3s & PE versions Signed-off-by: Tyler Gillson --- test/templates/two-node-cluster-profile.json.tmpl | 2 +- test/templates/two-node-create.json.tmpl | 2 +- test/test-two-node.sh | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/templates/two-node-cluster-profile.json.tmpl b/test/templates/two-node-cluster-profile.json.tmpl index 34f1b69..b8d8c8c 100644 --- a/test/templates/two-node-cluster-profile.json.tmpl +++ b/test/templates/two-node-cluster-profile.json.tmpl @@ -16,7 +16,7 @@ "layer": "os", "version": "1.0.0", "tag": "1.0.0", - "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-1.26.4-v4.1.2-STYLUS_HASH\"", + "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K3S_VERSION-vPE_VERSION-STYLUS_HASH\"", "registry": { "metadata": { "uid": "_____place_holder_____", diff --git a/test/templates/two-node-create.json.tmpl b/test/templates/two-node-create.json.tmpl index 563ffc7..266519b 100644 --- a/test/templates/two-node-create.json.tmpl +++ b/test/templates/two-node-create.json.tmpl @@ -89,7 +89,7 @@ "tag": "1.0.0", "name": "edge-native-byoi", "type": "spectro", - "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-1.26.4-v4.1.2-STYLUS_HASH\"", + "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K3S_VERSION-vPE_VERSION-STYLUS_HASH\"", "manifests": [] }, { diff --git a/test/test-two-node.sh b/test/test-two-node.sh index 340197a..de33bf4 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -270,6 +270,8 @@ function prepare_cluster_profile() { .spec.template.packs[1].registry.metadata.uid = env.PUBLIC_PACK_REPO_UID | .spec.template.packs[2].registry.metadata.uid = env.PUBLIC_PACK_REPO_UID | .spec.template.packs[0].values |= gsub("OCI_REGISTRY"; env.OCI_REGISTRY) | + .spec.template.packs[0].values |= gsub("PE_VERSION"; env.PE_VERSION) | + .spec.template.packs[0].values |= gsub("K3S_VERSION"; "1.26.4") | .spec.template.packs[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) ' test/templates/two-node-cluster-profile.json.tmpl > two-node-cluster-profile.json } @@ -314,6 +316,8 @@ function prepare_cluster() { .spec.machinePoolConfig[1].cloudConfig.edgeHosts[0].nicName = env.NIC_NAME | .spec.profiles[0].uid = env.CLUSTER_PROFILE_UID | .spec.profiles[0].packValues[0].values |= gsub("OCI_REGISTRY"; env.OCI_REGISTRY) | + .spec.profiles[0].packValues[0].values |= gsub("PE_VERSION"; env.PE_VERSION) | + .spec.profiles[0].packValues[0].values |= gsub("K3S_VERSION"; "1.26.4") | .spec.profiles[0].packValues[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) ' test/templates/two-node-create.json.tmpl > two-node-create.json }