diff --git a/docs/resources/addon_deployment.md b/docs/resources/addon_deployment.md
index bfa4e679..ccbf65a0 100644
--- a/docs/resources/addon_deployment.md
+++ b/docs/resources/addon_deployment.md
@@ -41,6 +41,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_aks.md b/docs/resources/cluster_aks.md
index 6c281a41..d80188a4 100644
--- a/docs/resources/cluster_aks.md
+++ b/docs/resources/cluster_aks.md
@@ -243,6 +243,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_aws.md b/docs/resources/cluster_aws.md
index 3c022ea9..d3cbcc3e 100644
--- a/docs/resources/cluster_aws.md
+++ b/docs/resources/cluster_aws.md
@@ -270,6 +270,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_azure.md b/docs/resources/cluster_azure.md
index d2f5c97e..7b32b74c 100644
--- a/docs/resources/cluster_azure.md
+++ b/docs/resources/cluster_azure.md
@@ -252,6 +252,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_custom_cloud.md b/docs/resources/cluster_custom_cloud.md
index 88d9732c..48e323f7 100644
--- a/docs/resources/cluster_custom_cloud.md
+++ b/docs/resources/cluster_custom_cloud.md
@@ -235,6 +235,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_edge_native.md b/docs/resources/cluster_edge_native.md
index f287fd28..554b37d7 100644
--- a/docs/resources/cluster_edge_native.md
+++ b/docs/resources/cluster_edge_native.md
@@ -215,6 +215,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_edge_vsphere.md b/docs/resources/cluster_edge_vsphere.md
index 8508a137..f68261b9 100644
--- a/docs/resources/cluster_edge_vsphere.md
+++ b/docs/resources/cluster_edge_vsphere.md
@@ -171,6 +171,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_eks.md b/docs/resources/cluster_eks.md
index 565b0d5f..70c31c4f 100644
--- a/docs/resources/cluster_eks.md
+++ b/docs/resources/cluster_eks.md
@@ -234,6 +234,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_gcp.md b/docs/resources/cluster_gcp.md
index 1bc5d4da..954ffc24 100644
--- a/docs/resources/cluster_gcp.md
+++ b/docs/resources/cluster_gcp.md
@@ -204,6 +204,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_gke.md b/docs/resources/cluster_gke.md
index e8caa13a..0cd64e72 100644
--- a/docs/resources/cluster_gke.md
+++ b/docs/resources/cluster_gke.md
@@ -185,6 +185,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_group.md b/docs/resources/cluster_group.md
index 2df02679..cef761e9 100644
--- a/docs/resources/cluster_group.md
+++ b/docs/resources/cluster_group.md
@@ -86,6 +86,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_import.md b/docs/resources/cluster_import.md
index 6a524052..b85e6100 100644
--- a/docs/resources/cluster_import.md
+++ b/docs/resources/cluster_import.md
@@ -86,6 +86,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_maas.md b/docs/resources/cluster_maas.md
index 7350d112..0a6b6ce8 100644
--- a/docs/resources/cluster_maas.md
+++ b/docs/resources/cluster_maas.md
@@ -251,6 +251,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_openstack.md b/docs/resources/cluster_openstack.md
index c62cd4bd..5a38f022 100644
--- a/docs/resources/cluster_openstack.md
+++ b/docs/resources/cluster_openstack.md
@@ -209,6 +209,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_tke.md b/docs/resources/cluster_tke.md
index 609abce1..66b790ce 100644
--- a/docs/resources/cluster_tke.md
+++ b/docs/resources/cluster_tke.md
@@ -141,6 +141,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/cluster_vsphere.md b/docs/resources/cluster_vsphere.md
index 5b194726..81bc3ce6 100644
--- a/docs/resources/cluster_vsphere.md
+++ b/docs/resources/cluster_vsphere.md
@@ -175,6 +175,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/docs/resources/virtual_cluster.md b/docs/resources/virtual_cluster.md
index f8ee1870..21daa632 100644
--- a/docs/resources/virtual_cluster.md
+++ b/docs/resources/virtual_cluster.md
@@ -127,6 +127,7 @@ Required:
Optional:
- `pack` (Block List) For packs of type `spectro`, `helm`, and `manifest`, at least one pack must be specified. (see [below for nested schema](#nestedblock--cluster_profile--pack))
+- `variables` (Map of String) A map of cluster profile variables, specified as key-value pairs. For example: `priority = "5"`.
### Nested Schema for `cluster_profile.pack`
diff --git a/examples/resources/spectrocloud_cluster_aws/resource.tf b/examples/resources/spectrocloud_cluster_aws/resource.tf
index f85ee121..698d1952 100644
--- a/examples/resources/spectrocloud_cluster_aws/resource.tf
+++ b/examples/resources/spectrocloud_cluster_aws/resource.tf
@@ -26,6 +26,11 @@ resource "spectrocloud_cluster_aws" "cluster" {
cluster_profile {
id = data.spectrocloud_cluster_profile.profile.id
+ variables = {
+ "priority" = "5",
+ "default_cmd" = "pwd"
+ }
+
# To override or specify values for a cluster:
# pack {
diff --git a/go.mod b/go.mod
index 4b891bbe..cfdc801c 100644
--- a/go.mod
+++ b/go.mod
@@ -12,8 +12,8 @@ require (
github.com/robfig/cron v1.2.0
github.com/spectrocloud/gomi v1.14.1-0.20240214074114-c19394812368
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d
- github.com/spectrocloud/palette-sdk-go v0.0.0-20241119151816-43a4f46d482e
- github.com/stretchr/testify v1.9.0
+ github.com/spectrocloud/palette-sdk-go v0.0.0-20241219153631-ca32d3fd7126
+ github.com/stretchr/testify v1.10.0
gotest.tools v2.2.0+incompatible
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
@@ -72,7 +72,7 @@ require (
github.com/imdario/mergo v0.3.15 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
@@ -100,17 +100,18 @@ require (
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
- go.mongodb.org/mongo-driver v1.16.0 // indirect
- go.opentelemetry.io/otel v1.28.0 // indirect
- go.opentelemetry.io/otel/metric v1.28.0 // indirect
- go.opentelemetry.io/otel/trace v1.28.0 // indirect
- golang.org/x/crypto v0.22.0 // indirect
+ go.mongodb.org/mongo-driver v1.17.1 // indirect
+ go.opentelemetry.io/auto/sdk v1.1.0 // indirect
+ go.opentelemetry.io/otel v1.33.0 // indirect
+ go.opentelemetry.io/otel/metric v1.33.0 // indirect
+ go.opentelemetry.io/otel/trace v1.33.0 // indirect
+ golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
- golang.org/x/mod v0.13.0 // indirect
+ golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.21.0 // indirect
- golang.org/x/sync v0.7.0 // indirect
- golang.org/x/sys v0.22.0 // indirect
- golang.org/x/text v0.14.0 // indirect
+ golang.org/x/sync v0.10.0 // indirect
+ golang.org/x/sys v0.28.0 // indirect
+ golang.org/x/text v0.17.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.57.1 // indirect
diff --git a/go.sum b/go.sum
index e39c9b25..24ffef72 100644
--- a/go.sum
+++ b/go.sum
@@ -445,8 +445,9 @@ github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPK
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
+github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
@@ -568,8 +569,8 @@ github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfm
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
-github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
+github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
+github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -600,8 +601,8 @@ github.com/spectrocloud/gomi v1.14.1-0.20240214074114-c19394812368 h1:eY0BOyEbGu
github.com/spectrocloud/gomi v1.14.1-0.20240214074114-c19394812368/go.mod h1:LlZ9We4kDaELYi7Is0SVmnySuDhwphJLS6ZT4wXxFIk=
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d h1:OMRbHxMJ1a+G1BYzvUYuMM0wLkYJPdnEOFx16faQ/UY=
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d/go.mod h1:MktpRPnSXDTHsQrFSD+daJFQ1zMLSR+1gWOL31jVvWE=
-github.com/spectrocloud/palette-sdk-go v0.0.0-20241119151816-43a4f46d482e h1:l6PSTaV0PJMaalqKPhOiWP+I6UwAxgU/2kpXTfdPC/w=
-github.com/spectrocloud/palette-sdk-go v0.0.0-20241119151816-43a4f46d482e/go.mod h1:dSlNvDS0qwUWTbrYI6P8x981mcbbRHFrBg67v5zl81U=
+github.com/spectrocloud/palette-sdk-go v0.0.0-20241219153631-ca32d3fd7126 h1:jsUjl47xKbjaRFTU02PztidQiFNAj5i8S9A1nDMfRh8=
+github.com/spectrocloud/palette-sdk-go v0.0.0-20241219153631-ca32d3fd7126/go.mod h1:Zv1+/Imw/lIOPAa+q9TzdyKiXmIzfLSwVTj11WemIZc=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
@@ -628,8 +629,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
-github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
-github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
+github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
@@ -662,8 +663,8 @@ go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lL
go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE=
go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc=
go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4=
-go.mongodb.org/mongo-driver v1.16.0 h1:tpRsfBJMROVHKpdGyc1BBEzzjDUWjItxbVSZ8Ls4BQ4=
-go.mongodb.org/mongo-driver v1.16.0/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw=
+go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
+go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -671,16 +672,18 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
+go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
+go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4=
go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo=
-go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
-go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw=
+go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I=
go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU=
-go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
-go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
+go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ=
+go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M=
go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw=
go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
@@ -688,8 +691,8 @@ go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35
go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE=
go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE=
go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
-go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
-go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
+go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s=
+go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
@@ -715,8 +718,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
-golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
-golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
+golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
+golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -757,8 +760,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
-golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
+golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -843,8 +846,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
-golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
+golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -925,8 +928,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
-golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
+golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -945,8 +948,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
-golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
+golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1015,8 +1018,8 @@ golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpd
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
-golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
+golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/spectrocloud/cluster_common_profiles.go b/spectrocloud/cluster_common_profiles.go
index 6856a6aa..c5f0c5cb 100644
--- a/spectrocloud/cluster_common_profiles.go
+++ b/spectrocloud/cluster_common_profiles.go
@@ -3,6 +3,7 @@ package spectrocloud
import (
"context"
"fmt"
+ "github.com/spectrocloud/gomi/pkg/ptr"
"log"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -53,6 +54,17 @@ func toProfilesCommon(c *client.V1Client, d *schema.ResourceData, clusterUID, co
if len(profiles) > 0 {
for _, profile := range profiles {
p := profile.(map[string]interface{})
+ // Profile Variables handling
+ pVars := make([]*models.V1SpectroClusterVariable, 0)
+ if pv, ok := p["variables"]; ok && pv != nil {
+ variables := p["variables"].(map[string]interface{})
+ for key, value := range variables {
+ pVars = append(pVars, &models.V1SpectroClusterVariable{
+ Name: ptr.StringPtr(key),
+ Value: value.(string),
+ })
+ }
+ }
packValues := make([]*models.V1PackValuesEntity, 0)
for _, pack := range p["pack"].([]interface{}) {
@@ -62,6 +74,7 @@ func toProfilesCommon(c *client.V1Client, d *schema.ResourceData, clusterUID, co
resp = append(resp, &models.V1SpectroClusterProfileEntity{
UID: p["id"].(string),
PackValues: packValues,
+ Variables: pVars,
})
}
}
diff --git a/spectrocloud/resource_cluster_profile.go b/spectrocloud/resource_cluster_profile.go
index 66389c63..0006c64a 100644
--- a/spectrocloud/resource_cluster_profile.go
+++ b/spectrocloud/resource_cluster_profile.go
@@ -2,7 +2,6 @@ package spectrocloud
import (
"context"
- "errors"
"fmt"
"github.com/spectrocloud/gomi/pkg/ptr"
@@ -478,16 +477,6 @@ func toClusterProfileVariables(d *schema.ResourceData) ([]*models.V1Variable, er
var profileVariables []*models.V1Variable
if pVariables, ok := d.GetOk("profile_variables"); ok {
- // Once the profile_Variables feature is extended to all cloud types, the following block should be removed.
- cloudType, _ := d.Get("cloud").(string)
- profileType, _ := d.Get("type").(string)
- if cloudType != "edge-native" {
- if profileType != "add-on" {
- err := errors.New("currently, `profile_variables` is only supported for the `add-on` profile type and other profile type is supported only for edge-native cloud type")
- return profileVariables, err
- }
- }
-
if pVariables.([]interface{})[0] != nil {
variables := pVariables.([]interface{})[0].(map[string]interface{})["variable"]
for _, v := range variables.([]interface{}) {
diff --git a/spectrocloud/resource_cluster_profile_test.go b/spectrocloud/resource_cluster_profile_test.go
index f1e1e197..5e02d6ff 100644
--- a/spectrocloud/resource_cluster_profile_test.go
+++ b/spectrocloud/resource_cluster_profile_test.go
@@ -204,8 +204,8 @@ func TestToClusterProfileVariablesRestrictionError(t *testing.T) {
result, err := toClusterProfileVariables(mockResourceData)
// Assertions for valid profile variables
- assert.Error(t, err)
- assert.Len(t, result, 0)
+ assert.NoError(t, err)
+ assert.Len(t, result, 2)
_ = mockResourceData.Set("cloud", "edge-native")
_ = mockResourceData.Set("type", "infra")
@@ -228,8 +228,8 @@ func TestToClusterProfileVariablesRestrictionError(t *testing.T) {
_ = mockResourceData.Set("cloud", "aws")
_ = mockResourceData.Set("type", "infra")
result, err = toClusterProfileVariables(mockResourceData)
- assert.Error(t, err)
- assert.Len(t, result, 0)
+ assert.NoError(t, err)
+ assert.Len(t, result, 2)
_ = mockResourceData.Set("cloud", "edge-native")
_ = mockResourceData.Set("type", "add-on")
@@ -462,7 +462,7 @@ func TestResourceClusterProfileCreate(t *testing.T) {
func TestResourceClusterProfileCreateError(t *testing.T) {
d := prepareBaseClusterProfileTestData()
var ctx context.Context
- diags := resourceClusterProfileCreate(ctx, d, unitTestMockAPIClient)
+ diags := resourceClusterProfileCreate(ctx, d, unitTestMockAPINegativeClient)
assert.NotEmpty(t, diags)
}
diff --git a/spectrocloud/schemas/cluster_profile.go b/spectrocloud/schemas/cluster_profile.go
index e48fc0d7..baeea623 100644
--- a/spectrocloud/schemas/cluster_profile.go
+++ b/spectrocloud/schemas/cluster_profile.go
@@ -16,6 +16,14 @@ func ClusterProfileSchema() *schema.Schema {
Description: "The ID of the cluster profile.",
},
"pack": PackSchema(),
+ "variables": {
+ Type: schema.TypeMap,
+ Optional: true,
+ Description: "A map of cluster profile variables, specified as key-value pairs. For example: `priority = \"5\"`.",
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
},
},
}