From 686c8975d16082d5ca257bce0174fb70bde7fcf8 Mon Sep 17 00:00:00 2001 From: Robert Nemeti Date: Thu, 4 Jul 2024 17:38:59 +0200 Subject: [PATCH] remove project_id from application credentials --- metakube/resource_cluster_role_binding_test.go | 2 +- metakube/resource_cluster_test.go | 15 ++++++--------- metakube/resource_maintenance_cronjob_test.go | 2 +- metakube/resource_node_deployment_test.go | 5 ++--- metakube/resource_role_binding_test.go | 2 +- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/metakube/resource_cluster_role_binding_test.go b/metakube/resource_cluster_role_binding_test.go index 531872a..09fd42e 100644 --- a/metakube/resource_cluster_role_binding_test.go +++ b/metakube/resource_cluster_role_binding_test.go @@ -15,7 +15,7 @@ func TestAccMetakubeClusterRoleBinding(t *testing.T) { t.Parallel() resourceName := "metakube_cluster_role_binding.acctest" params := &testAccCheckMetaKubeClusterRoleBindingBasicParams{ - ClusterName: randomName("testacc", 5), + ClusterName: makeRandomName() + "-cluster-role-binding", DatacenterName: os.Getenv(testEnvOpenstackNodeDC), ProjectID: os.Getenv(testEnvProjectID), Version: os.Getenv(testEnvK8sVersionOpenstack), diff --git a/metakube/resource_cluster_test.go b/metakube/resource_cluster_test.go index 08621c9..b397c5c 100644 --- a/metakube/resource_cluster_test.go +++ b/metakube/resource_cluster_test.go @@ -372,9 +372,8 @@ resource "metakube_cluster" "acctest_cluster" { cloud { openstack { application_credentials { - project_id = "{{ .OpenstackProjectID }}" - application_credential_id = "{{ .OpenstackApplicationCredentialsID }}" - application_credential_secret = "{{ .OpenstackApplicationCredentialsSecret }}" + id = "{{ .OpenstackApplicationCredentialsID }}" + secret = "{{ .OpenstackApplicationCredentialsSecret }}" } floating_ip_pool = "ext-net" security_group = openstack_networking_secgroup_v2.cluster-net.name @@ -614,9 +613,8 @@ resource "metakube_cluster" "acctest_cluster" { cloud { openstack { application_credentials { - project_id = "{{ .OpenstackProjectID }}" - application_credential_id = "{{ .OpenstackApplicationCredentialsID }}" - application_credential_secret = "{{ .OpenstackApplicationCredentialsSecret }}" + id = "{{ .OpenstackApplicationCredentialsID }}" + secret = "{{ .OpenstackApplicationCredentialsSecret }}" } floating_ip_pool = "ext-net" } @@ -646,9 +644,8 @@ resource "metakube_cluster" "acctest_cluster" { cloud { openstack { application_credentials { - project_id = "{{ .OpenstackProjectID }}" - application_credential_id = "{{ .OpenstackApplicationCredentialsID }}" - application_credential_secret = "{{ .OpenstackApplicationCredentialsSecret }}" + id = "{{ .OpenstackApplicationCredentialsID }}" + secret = "{{ .OpenstackApplicationCredentialsSecret }}" } floating_ip_pool = "ext-net" } diff --git a/metakube/resource_maintenance_cronjob_test.go b/metakube/resource_maintenance_cronjob_test.go index b39560c..e05d41c 100644 --- a/metakube/resource_maintenance_cronjob_test.go +++ b/metakube/resource_maintenance_cronjob_test.go @@ -19,7 +19,7 @@ func TestAccMetakubeCluster_MaintenanceCronJob_Basic(t *testing.T) { resourceName := "metakube_maintenance_cron_job.acctest" params := &testAccCheckMetaKubeMaintenanceCronJobBasicParams{ - ClusterName: randomName("testacc", 5), + ClusterName: makeRandomName() + "-maint-cron-job", DatacenterName: os.Getenv(testEnvOpenstackNodeDC), ProjectID: os.Getenv(testEnvProjectID), Version: os.Getenv(testEnvK8sVersionOpenstack), diff --git a/metakube/resource_node_deployment_test.go b/metakube/resource_node_deployment_test.go index bf8aa8e..a267cc2 100644 --- a/metakube/resource_node_deployment_test.go +++ b/metakube/resource_node_deployment_test.go @@ -189,9 +189,8 @@ var nodeDeploymentBasicTemplate = mustParseTemplate("nodeDeploymentBasic", ` cloud { openstack { application_credentials { - project_id = "{{ .OpenstackProjectID }}" - application_credential_id = "{{ .OpenstackApplicationCredentialsID }}" - application_credential_secret = "{{ .OpenstackApplicationCredentialsSecret }}" + id = "{{ .OpenstackApplicationCredentialsID }}" + secret = "{{ .OpenstackApplicationCredentialsSecret }}" } floating_ip_pool = "ext-net" } diff --git a/metakube/resource_role_binding_test.go b/metakube/resource_role_binding_test.go index 38176e1..f46e518 100644 --- a/metakube/resource_role_binding_test.go +++ b/metakube/resource_role_binding_test.go @@ -15,7 +15,7 @@ func TestAccMetakubeRoleBinding(t *testing.T) { t.Parallel() resourceName := "metakube_role_binding.acctest" params := &testAccCheckMetaKubeRoleBindingBasicParams{ - ClusterName: randomName("testacc", 5), + ClusterName: makeRandomName() + "-role-binding", DatacenterName: os.Getenv(testEnvOpenstackNodeDC), ProjectID: os.Getenv(testEnvProjectID), Version: os.Getenv(testEnvK8sVersionOpenstack),