Skip to content

Commit

Permalink
Add kubeconfig key to conn details secret
Browse files Browse the repository at this point in the history
Fixes crossplane-contrib#112

Signed-off-by: Hasan Turken <[email protected]>
  • Loading branch information
turkenh committed Dec 11, 2021
1 parent 3e6a047 commit 832bfbd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/kubernetes/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ func Configure(p *config.Provider) {
r.ExternalName.GetExternalNameFn = common.GetNameFromFullyQualifiedID
// /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/group1/providers/Microsoft.ContainerService/managedClusters/cluster1
r.ExternalName.GetIDFn = common.GetFullyQualifiedIDFn("Microsoft.ContainerService", "managedClusters", "name")

r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]interface{}) (map[string][]byte, error) {
if kc, ok := attr["kube_config_raw"].(string); ok {
return map[string][]byte{
"kubeconfig": []byte(kc),
}, nil
}
return nil, nil
}
})

p.AddResourceConfigurator("azurerm_kubernetes_cluster_node_pool", func(r *config.Resource) {
Expand Down

0 comments on commit 832bfbd

Please sign in to comment.