Skip to content

Commit a963eaf

Browse files
author
sfang97
committed
Address PR comments
1 parent cb2bf63 commit a963eaf

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

gitlab/resource_gitlab_instance_cluster.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func resourceGitlabInstanceCluster() *schema.Resource {
3838
Type: schema.TypeBool,
3939
Optional: true,
4040
Default: true,
41+
ForceNew: true,
4142
},
4243
"created_at": {
4344
Type: schema.TypeString,
@@ -200,6 +201,10 @@ func resourceGitlabInstanceClusterUpdate(d *schema.ResourceData, meta interface{
200201
options.EnvironmentScope = gitlab.String(d.Get("environment_scope").(string))
201202
}
202203

204+
if d.HasChange("enabled") {
205+
options.Enabled = gitlab.Bool(d.Get("enabled").(bool))
206+
}
207+
203208
pk := &gitlab.EditPlatformKubernetesOptions{}
204209

205210
if d.HasChange("kubernetes_api_url") {
@@ -214,6 +219,10 @@ func resourceGitlabInstanceClusterUpdate(d *schema.ResourceData, meta interface{
214219
pk.CaCert = gitlab.String(d.Get("kubernetes_ca_cert").(string))
215220
}
216221

222+
if d.HasChange("namespace") {
223+
pk.Namespace = gitlab.String(d.Get("namespace").(string))
224+
}
225+
217226
if *pk != (gitlab.EditPlatformKubernetesOptions{}) {
218227
options.PlatformKubernetes = pk
219228
}

gitlab/resource_gitlab_instance_cluster_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func TestAccGitlabInstanceCluster_basic(t *testing.T) {
6363
KubernetesApiURL: "https://124.124.124",
6464
KubernetesCACert: instanceClusterFakeCert,
6565
KubernetesAuthorizationType: "abac",
66+
Managed: true,
6667
}),
6768
),
6869
},
@@ -125,11 +126,11 @@ type testAccGitlabInstanceClusterExpectedAttributes struct {
125126
Name string
126127
Domain string
127128
EnvironmentScope string
129+
Managed bool
128130
KubernetesApiURL string
129131
KubernetesCACert string
130132
KubernetesAuthorizationType string
131133
ManagementProjectID string
132-
Managed bool
133134
}
134135

135136
func testAccCheckGitlabInstanceClusterExists(n string, cluster *gitlab.InstanceCluster) resource.TestCheckFunc {
@@ -217,7 +218,6 @@ func testAccCheckGitlabInstanceClusterAttributes(cluster *gitlab.InstanceCluster
217218

218219
func testAccGitlabInstanceClusterConfig(rInt int, managed bool) string {
219220
m := fmt.Sprintf("%t", managed)
220-
fmt.Println(m)
221221

222222
return fmt.Sprintf(`
223223
variable "cert" {

website/docs/r/instance_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The following arguments are supported:
5353

5454
- `environment_scope` - (Optional, string) The associated environment to the cluster. Defaults to `*`.
5555

56-
- `management_project_id` - (Optional, string) The ID of the management instance for the cluster.
56+
- `management_project_id` - (Optional, string) The ID of the management project for the cluster.
5757

5858
## Import
5959

0 commit comments

Comments
 (0)