diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 1197b7b6..d3b662af 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -24,6 +24,13 @@ resource "local_file" "kubeconfig" { file_permission = "0644" directory_permission = "0755" } + +resource "local_file" "adminkubeconfig" { + content = data.spectrocloud_cluster.cluster.admin_kube_config + filename = "admin-client-101.kubeconfig" + file_permission = "0644" + directory_permission = "0755" +} ``` @@ -39,6 +46,7 @@ resource "local_file" "kubeconfig" { ### Read-Only +- `admin_kube_config` (String) - `id` (String) The ID of this resource. - `kube_config` (String) diff --git a/docs/resources/cluster_aks.md b/docs/resources/cluster_aks.md index 5da64e81..b3bfd250 100644 --- a/docs/resources/cluster_aks.md +++ b/docs/resources/cluster_aks.md @@ -120,6 +120,7 @@ resource "spectrocloud_cluster_aks" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_aws.md b/docs/resources/cluster_aws.md index e310f16f..ffc379bc 100644 --- a/docs/resources/cluster_aws.md +++ b/docs/resources/cluster_aws.md @@ -151,6 +151,7 @@ resource "spectrocloud_cluster_aws" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_azure.md b/docs/resources/cluster_azure.md index 7bfd7cbe..964df576 100644 --- a/docs/resources/cluster_azure.md +++ b/docs/resources/cluster_azure.md @@ -114,6 +114,7 @@ resource "spectrocloud_cluster_azure" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_coxedge.md b/docs/resources/cluster_coxedge.md index f6e99403..31a4610c 100644 --- a/docs/resources/cluster_coxedge.md +++ b/docs/resources/cluster_coxedge.md @@ -43,6 +43,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_edge_native.md b/docs/resources/cluster_edge_native.md index 1425736b..0ca9592b 100644 --- a/docs/resources/cluster_edge_native.md +++ b/docs/resources/cluster_edge_native.md @@ -46,6 +46,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_edge_vsphere.md b/docs/resources/cluster_edge_vsphere.md index a12f272c..a65674fb 100644 --- a/docs/resources/cluster_edge_vsphere.md +++ b/docs/resources/cluster_edge_vsphere.md @@ -45,6 +45,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_eks.md b/docs/resources/cluster_eks.md index 06852e68..0a697c09 100644 --- a/docs/resources/cluster_eks.md +++ b/docs/resources/cluster_eks.md @@ -119,6 +119,7 @@ resource "spectrocloud_cluster_eks" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_gcp.md b/docs/resources/cluster_gcp.md index 38fab817..11271371 100644 --- a/docs/resources/cluster_gcp.md +++ b/docs/resources/cluster_gcp.md @@ -111,6 +111,7 @@ resource "spectrocloud_cluster_gcp" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_libvirt.md b/docs/resources/cluster_libvirt.md index 7ca9cac2..cd896fd7 100644 --- a/docs/resources/cluster_libvirt.md +++ b/docs/resources/cluster_libvirt.md @@ -46,6 +46,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_maas.md b/docs/resources/cluster_maas.md index e8ba3b96..41b2c86a 100644 --- a/docs/resources/cluster_maas.md +++ b/docs/resources/cluster_maas.md @@ -121,6 +121,7 @@ resource "spectrocloud_cluster_maas" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_openstack.md b/docs/resources/cluster_openstack.md index 1f77cf46..73c96f4a 100644 --- a/docs/resources/cluster_openstack.md +++ b/docs/resources/cluster_openstack.md @@ -112,6 +112,7 @@ resource "spectrocloud_cluster_openstack" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_tke.md b/docs/resources/cluster_tke.md index 2f3216af..03af7b3e 100644 --- a/docs/resources/cluster_tke.md +++ b/docs/resources/cluster_tke.md @@ -42,6 +42,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/cluster_vsphere.md b/docs/resources/cluster_vsphere.md index a03c8fdd..d4ea04a3 100644 --- a/docs/resources/cluster_vsphere.md +++ b/docs/resources/cluster_vsphere.md @@ -46,6 +46,7 @@ description: |- ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/docs/resources/virtual_cluster.md b/docs/resources/virtual_cluster.md index eca48d19..d775da7e 100644 --- a/docs/resources/virtual_cluster.md +++ b/docs/resources/virtual_cluster.md @@ -79,6 +79,7 @@ resource "spectrocloud_virtual_cluster" "cluster" { ### Read-Only +- `admin_kube_config` (String) Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege. - `cloud_config_id` (String, Deprecated) ID of the cloud config used for the cluster. This cloud config must be of type `azure`. - `id` (String) The ID of this resource. - `kubeconfig` (String) Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`. diff --git a/go.mod b/go.mod index 0b1d8292..632f6bc5 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/hashicorp/terraform-plugin-docs v0.13.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 github.com/robfig/cron v1.2.0 - github.com/spectrocloud/hapi v1.14.1-0.20230814141242-394093e7fedb - github.com/spectrocloud/palette-sdk-go v0.0.0-20230829045040-bf4cc9aa60e1 + github.com/spectrocloud/hapi v1.14.1-0.20230921130725-2afc79a3ea05 + github.com/spectrocloud/palette-sdk-go v0.0.0-20230922231546-16c6a64a7c0c github.com/stretchr/testify v1.8.0 gotest.tools v2.2.0+incompatible k8s.io/api v0.23.5 @@ -120,4 +120,4 @@ require ( ) //replace github.com/spectrocloud/hapi => ../hapi -replace github.com/spectrocloud/palette-sdk-go => ../palette-sdk-go +//replace github.com/spectrocloud/palette-sdk-go => ../palette-sdk-go diff --git a/go.sum b/go.sum index 7c78fa24..2e4dbe1a 100644 --- a/go.sum +++ b/go.sum @@ -693,6 +693,7 @@ github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNl github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= @@ -715,10 +716,10 @@ github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spectrocloud/gomi v1.14.1-0.20230412095143-b0595c6c6f08 h1:AnOC0U+ExlKBeT5yF2Pg8PPfVOfxwOUBS/5deOl1Q4Y= github.com/spectrocloud/gomi v1.14.1-0.20230412095143-b0595c6c6f08/go.mod h1:UnhUDpFEvtYh6m384r3xzj8/+Z6/hMp2O8whEMYVHec= -github.com/spectrocloud/hapi v1.14.1-0.20230814141242-394093e7fedb h1:Y/TDXfEZ6GJbYi4bKxFS0HFvmOL6Xs653BoxuZjuKEQ= -github.com/spectrocloud/hapi v1.14.1-0.20230814141242-394093e7fedb/go.mod h1:O/Bkbw92QPSGPNQPqKt7Qlkn+9BKK/a22KTUlk76KHI= -github.com/spectrocloud/palette-sdk-go v0.0.0-20230829045040-bf4cc9aa60e1 h1:gqnua/jMzX8fx9yt+niCxQ99XkzKiA+HF+LRbFbWYC8= -github.com/spectrocloud/palette-sdk-go v0.0.0-20230829045040-bf4cc9aa60e1/go.mod h1:xrvueWGPSRdonQkTQvJgDSPe5FRbuqpPJj7Ko0/yxrQ= +github.com/spectrocloud/hapi v1.14.1-0.20230921130725-2afc79a3ea05 h1:QHuGuSItjNA0iVda1OCvHlWDjps6NR1X1/pjlYmIOp8= +github.com/spectrocloud/hapi v1.14.1-0.20230921130725-2afc79a3ea05/go.mod h1:aI54jbfaSec1ikHSMOJQ7mMOTaRKpQTRCoMKamhBE9s= +github.com/spectrocloud/palette-sdk-go v0.0.0-20230922231546-16c6a64a7c0c h1:PSGaCVQGsgKymA73yRYBQ1Ick06QYEbH4W7no+k4a+M= +github.com/spectrocloud/palette-sdk-go v0.0.0-20230922231546-16c6a64a7c0c/go.mod h1:Om6X/eH6h787jrynu9NTAeuxFpC15E/Atco5kQwiM90= 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= @@ -784,6 +785,7 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= diff --git a/spectrocloud/resource_cluster_aks.go b/spectrocloud/resource_cluster_aks.go index ccc63575..eabce935 100644 --- a/spectrocloud/resource_cluster_aks.go +++ b/spectrocloud/resource_cluster_aks.go @@ -98,6 +98,11 @@ func resourceClusterAks() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_azure.go b/spectrocloud/resource_cluster_azure.go index c1beb411..aa668a45 100644 --- a/spectrocloud/resource_cluster_azure.go +++ b/spectrocloud/resource_cluster_azure.go @@ -99,6 +99,11 @@ func resourceClusterAzure() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_coxedge.go b/spectrocloud/resource_cluster_coxedge.go index 3221a27c..d21d9008 100644 --- a/spectrocloud/resource_cluster_coxedge.go +++ b/spectrocloud/resource_cluster_coxedge.go @@ -97,6 +97,11 @@ func resourceClusterCoxEdge() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_edge_native.go b/spectrocloud/resource_cluster_edge_native.go index 2165e804..61b14228 100644 --- a/spectrocloud/resource_cluster_edge_native.go +++ b/spectrocloud/resource_cluster_edge_native.go @@ -97,6 +97,11 @@ func resourceClusterEdgeNative() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_edge_vsphere.go b/spectrocloud/resource_cluster_edge_vsphere.go index 77b640de..9494918b 100644 --- a/spectrocloud/resource_cluster_edge_vsphere.go +++ b/spectrocloud/resource_cluster_edge_vsphere.go @@ -86,6 +86,11 @@ func resourceClusterEdgeVsphere() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_eks.go b/spectrocloud/resource_cluster_eks.go index 56539037..f05bfdb6 100644 --- a/spectrocloud/resource_cluster_eks.go +++ b/spectrocloud/resource_cluster_eks.go @@ -99,6 +99,11 @@ func resourceClusterEks() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_gcp.go b/spectrocloud/resource_cluster_gcp.go index 59cc725f..101af045 100644 --- a/spectrocloud/resource_cluster_gcp.go +++ b/spectrocloud/resource_cluster_gcp.go @@ -97,6 +97,11 @@ func resourceClusterGcp() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_libvirt.go b/spectrocloud/resource_cluster_libvirt.go index 4eb71496..5ba018ad 100644 --- a/spectrocloud/resource_cluster_libvirt.go +++ b/spectrocloud/resource_cluster_libvirt.go @@ -99,6 +99,11 @@ func resourceClusterLibvirt() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_maas.go b/spectrocloud/resource_cluster_maas.go index 87aa0db5..7d39d199 100644 --- a/spectrocloud/resource_cluster_maas.go +++ b/spectrocloud/resource_cluster_maas.go @@ -97,6 +97,11 @@ func resourceClusterMaas() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_openstack.go b/spectrocloud/resource_cluster_openstack.go index 0786fd6b..49557335 100644 --- a/spectrocloud/resource_cluster_openstack.go +++ b/spectrocloud/resource_cluster_openstack.go @@ -97,6 +97,11 @@ func resourceClusterOpenStack() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_tke.go b/spectrocloud/resource_cluster_tke.go index e4293c77..ea565d8a 100644 --- a/spectrocloud/resource_cluster_tke.go +++ b/spectrocloud/resource_cluster_tke.go @@ -78,6 +78,11 @@ func resourceClusterTke() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_virtual.go b/spectrocloud/resource_cluster_virtual.go index 19474b26..71965a6c 100644 --- a/spectrocloud/resource_cluster_virtual.go +++ b/spectrocloud/resource_cluster_virtual.go @@ -139,6 +139,11 @@ func resourceClusterVirtual() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_vsphere.go b/spectrocloud/resource_cluster_vsphere.go index 432398ab..fbafe9c1 100644 --- a/spectrocloud/resource_cluster_vsphere.go +++ b/spectrocloud/resource_cluster_vsphere.go @@ -101,6 +101,11 @@ func resourceClusterVsphere() *schema.Resource { Computed: true, Description: "Kubeconfig for the cluster. This can be used to connect to the cluster using `kubectl`.", }, + "admin_kube_config": { + Type: schema.TypeString, + Computed: true, + Description: "Admin Kube-config for the cluster. This can be used to connect to the cluster using `kubectl`, With admin privilege.", + }, "cloud_config": { Type: schema.TypeList, ForceNew: true, diff --git a/spectrocloud/resource_cluster_vsphere_test.go b/spectrocloud/resource_cluster_vsphere_test.go index e07cc8a3..aea10312 100644 --- a/spectrocloud/resource_cluster_vsphere_test.go +++ b/spectrocloud/resource_cluster_vsphere_test.go @@ -338,6 +338,9 @@ func TestResourceClusterVsphereRead(t *testing.T) { GetClusterKubeConfigFn: func(uid string) (string, error) { return "testKubeConfig", nil }, + GetClusterAdminConfigFn: func(uid string) (string, error) { + return "testAdminKubeConfig", nil + }, GetClusterScanConfigFn: func(uid string) (*models.V1ClusterComplianceScan, error) { clusterCom := &models.V1ClusterComplianceScan{ Metadata: &models.V1ObjectMeta{