summaryrefslogtreecommitdiff
path: root/azuredevops
diff options
context:
space:
mode:
authorMathieu Ouellet <mathieu.ouellet@energumen.io>2022-09-10 07:44:05 -0400
committerMathieu Ouellet <mathieu.ouellet@energumen.io>2022-09-10 07:44:05 -0400
commit84825a950c141eb18491f95191c20c0e6abd2932 (patch)
tree7705eeb0e7f110bc087622fe96c492823668fabc /azuredevops
parent6d7382a23dfe6758025b8cfd0a074fe412e677c3 (diff)
fix plugin crash when optional cluster_context not specified
Signed-off-by: Mathieu Ouellet <mathieu.ouellet@energumen.io>
Diffstat (limited to 'azuredevops')
-rw-r--r--azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_kubernetes.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_kubernetes.go b/azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_kubernetes.go
index f5a210fc..929d184d 100644
--- a/azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_kubernetes.go
+++ b/azuredevops/internal/service/serviceendpoint/resource_serviceendpoint_kubernetes.go
@@ -95,6 +95,7 @@ func makeSchemaKubeconfig(r *schema.Resource) {
"cluster_context": {
Type: schema.TypeString,
Optional: true,
+ Computed: true,
Description: "Context of your cluster",
},
"accept_untrusted_certs": {
@@ -213,7 +214,7 @@ func expandServiceEndpointKubernetes(d *schema.ResourceData) (*serviceendpoint.S
errResult := fmt.Errorf("kube_config contains an invalid YAML: %s", err)
return nil, nil, errResult
}
- clusterContextInputList := kubeConfigYAMLUnmarshalled["contexts"].([]interface{})[0].(map[interface{}]interface{})
+ clusterContextInputList := kubeConfigYAMLUnmarshalled["contexts"].([]interface{})[0].(map[string]interface{})
clusterContextInput = clusterContextInputList["name"].(string)
}