Skip to content

Commit

Permalink
Use Rancher Cloud Credential ID for GKE
Browse files Browse the repository at this point in the history
Signed-off-by: Sverre Boschman <[email protected]>
  • Loading branch information
sboschman committed Jul 12, 2022
1 parent 0fecd3d commit 5846ebd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions apis/rancher2/v1alpha1/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion apis/rancher2/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/rancher2/v1alpha1/zz_generated_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions config/cluster/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cluster

import (
tjconfig "github.com/crossplane/terrajet/pkg/config"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func Configure(p *tjconfig.Provider) {
p.AddResourceConfigurator("rancher2_cluster", func(r *tjconfig.Resource) {
if block, ok := r.TerraformResource.Schema["gke_config_v2"]; ok {
if attr, ok := block.Elem.(*schema.Resource).Schema["google_credential_secret"]; ok {
attr.Description = "The GKE Cloud Credential ID to use"
attr.Sensitive = false
}
}
})
}
3 changes: 3 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

tjconfig "github.com/crossplane/terrajet/pkg/config"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/crossplane-contrib/provider-jet-rancher/config/cluster"
)

const (
Expand Down Expand Up @@ -46,6 +48,7 @@ func GetProvider() *tjconfig.Provider {

for _, configure := range []func(provider *tjconfig.Provider){
// add custom config functions
cluster.Configure,
} {
configure(pc)
}
Expand Down
22 changes: 4 additions & 18 deletions package/crds/rancher2.rancher.jet.crossplane.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1117,23 +1117,9 @@ spec:
enableKubernetesAlpha:
description: Enable Kubernetes alpha
type: boolean
googleCredentialSecretSecretRef:
description: Google credential secret
properties:
key:
description: The key to select.
type: string
name:
description: Name of the secret.
type: string
namespace:
description: Namespace of the secret.
type: string
required:
- key
- name
- namespace
type: object
googleCredentialSecret:
description: The GKE Cloud Credential ID to use
type: string
imported:
description: Is GKE cluster imported?
type: boolean
Expand Down Expand Up @@ -1374,7 +1360,7 @@ spec:
is empty
type: string
required:
- googleCredentialSecretSecretRef
- googleCredentialSecret
- name
- projectId
type: object
Expand Down

0 comments on commit 5846ebd

Please sign in to comment.