Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kubernetes): set kubernetes_ca_cert as sensitive #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions apis/kubernetes/v1alpha1/zz_authbackendconfig_types.go

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

11 changes: 3 additions & 8 deletions apis/kubernetes/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/kubernetes/v1alpha1/zz_generated_terraformed.go

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

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

import "github.com/upbound/upjet/pkg/config"

// Configure configures individual resources by adding custom ResourceConfigurators.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("vault_kubernetes_auth_backend_config", func(r *config.Resource) {
r.TerraformResource.Schema["kubernetes_ca_cert"].Sensitive = true
})
}
2 changes: 2 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
// Note(turkenh): we are importing this to embed provider schema document
_ "embed"

"github.com/upbound/provider-vault/config/kubernetesauthbackendconfig"
ujconfig "github.com/upbound/upjet/pkg/config"
)

Expand All @@ -33,6 +34,7 @@ func GetProvider() *ujconfig.Provider {

for _, configure := range []func(provider *ujconfig.Provider){
// add custom config functions
kubernetesauthbackendconfig.Configure,
} {
configure(pc)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,24 @@ spec:
description: Optional JWT issuer. If no issuer is specified, kubernetes.io/serviceaccount
will be used as the default issuer.
type: string
kubernetesCaCert:
kubernetesCaCertSecretRef:
description: PEM encoded CA cert for use by the TLS client used
to talk with the Kubernetes API.
type: string
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
kubernetesHost:
description: Host must be a host string, a host:port pair, or
a URL to the base of the Kubernetes API server.
Expand Down Expand Up @@ -333,10 +347,6 @@ spec:
description: Optional JWT issuer. If no issuer is specified, kubernetes.io/serviceaccount
will be used as the default issuer.
type: string
kubernetesCaCert:
description: PEM encoded CA cert for use by the TLS client used
to talk with the Kubernetes API.
type: string
kubernetesHost:
description: Host must be a host string, a host:port pair, or
a URL to the base of the Kubernetes API server.
Expand Down