Skip to content

Commit

Permalink
Fix acronyms in struct field names in kubeConfig.go and provider.go (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JaylonmcShan03 committed Oct 8, 2024
1 parent f8c3ea5 commit d733054
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions helm-framework/helm/kubeConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ func (m *Meta) NewKubeConfig(ctx context.Context, namespace string) (*KubeConfig
"insecureSkipTLSVerify": overrides.ClusterInfo.InsecureSkipTLSVerify,
})
}
if !kubernetesConfig.TlsServerName.IsNull() {
overrides.ClusterInfo.TLSServerName = kubernetesConfig.TlsServerName.ValueString()
if !kubernetesConfig.TLSServerName.IsNull() {
overrides.ClusterInfo.TLSServerName = kubernetesConfig.TLSServerName.ValueString()
fmt.Println("Setting TLS server name:", overrides.ClusterInfo.TLSServerName)
tflog.Debug(ctx, "Setting TLS server name", map[string]interface{}{
"tlsServerName": overrides.ClusterInfo.TLSServerName,
Expand Down Expand Up @@ -238,8 +238,8 @@ func (m *Meta) NewKubeConfig(ctx context.Context, namespace string) (*KubeConfig
"token": overrides.AuthInfo.Token,
})
}
if !kubernetesConfig.ProxyUrl.IsNull() {
overrides.ClusterDefaults.ProxyURL = kubernetesConfig.ProxyUrl.ValueString()
if !kubernetesConfig.ProxyURL.IsNull() {
overrides.ClusterDefaults.ProxyURL = kubernetesConfig.ProxyURL.ValueString()
fmt.Println("Setting proxy URL:", overrides.ClusterDefaults.ProxyURL)
tflog.Debug(ctx, "Setting proxy URL", map[string]interface{}{
"proxyURL": overrides.ClusterDefaults.ProxyURL,
Expand Down
24 changes: 12 additions & 12 deletions helm-framework/helm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ type KubernetesConfigModel struct {
Username types.String `tfsdk:"username"`
Password types.String `tfsdk:"password"`
Insecure types.Bool `tfsdk:"insecure"`
TlsServerName types.String `tfsdk:"tls_server_name"`
TLSServerName types.String `tfsdk:"tls_server_name"`
ClientCertificate types.String `tfsdk:"client_certificate"`
ClientKey types.String `tfsdk:"client_key"`
ClusterCaCertificate types.String `tfsdk:"cluster_ca_certificate"`
ClusterCACertificate types.String `tfsdk:"cluster_ca_certificate"`
ConfigPaths types.List `tfsdk:"config_paths"`
ConfigPath types.String `tfsdk:"config_path"`
ConfigContext types.String `tfsdk:"config_context"`
ConfigContextAuthInfo types.String `tfsdk:"config_context_auth_info"`
ConfigContextCluster types.String `tfsdk:"config_context_cluster"`
Token types.String `tfsdk:"token"`
ProxyUrl types.String `tfsdk:"proxy_url"`
ProxyURL types.String `tfsdk:"proxy_url"`
// Exec types.List `tfsdk:"exec"`
}

type ExecConfigModel struct {
ApiVersion types.String `tfsdk:"api_version"`
APIVersion types.String `tfsdk:"api_version"`
Command types.String `tfsdk:"command"`
Env types.Map `tfsdk:"env"`
Args types.List `tfsdk:"args"`
Expand Down Expand Up @@ -320,7 +320,7 @@ func (p *HelmProvider) Configure(ctx context.Context, req provider.ConfigureRequ
kubeUser := os.Getenv("KUBE_USER")
kubePassword := os.Getenv("KUBE_PASSWORD")
kubeInsecureStr := os.Getenv("KUBE_INSECURE")
kubeTlsServerName := os.Getenv("KUBE_TLS_SERVER_NAME")
kubeTLSServerName := os.Getenv("KUBE_TLS_SERVER_NAME")
kubeClientCert := os.Getenv("KUBE_CLIENT_CERT_DATA")
kubeClientKey := os.Getenv("KUBE_CLIENT_KEY_DATA")
kubeCaCert := os.Getenv("KUBE_CLUSTER_CA_CERT_DATA")
Expand Down Expand Up @@ -412,17 +412,17 @@ func (p *HelmProvider) Configure(ctx context.Context, req provider.ConfigureRequ
if !kubernetesConfig.Password.IsNull() {
kubePassword = kubernetesConfig.Password.ValueString()
}
if !kubernetesConfig.TlsServerName.IsNull() {
kubeTlsServerName = kubernetesConfig.TlsServerName.ValueString()
if !kubernetesConfig.TLSServerName.IsNull() {
kubeTLSServerName = kubernetesConfig.TLSServerName.ValueString()
}
if !kubernetesConfig.ClientCertificate.IsNull() {
kubeClientCert = kubernetesConfig.ClientCertificate.ValueString()
}
if !kubernetesConfig.ClientKey.IsNull() {
kubeClientKey = kubernetesConfig.ClientKey.ValueString()
}
if !kubernetesConfig.ClusterCaCertificate.IsNull() {
kubeCaCert = kubernetesConfig.ClusterCaCertificate.ValueString()
if !kubernetesConfig.ClusterCACertificate.IsNull() {
kubeCaCert = kubernetesConfig.ClusterCACertificate.ValueString()
}
if kubeConfigPaths != "" {
for _, path := range filepath.Split(kubeConfigPaths) {
Expand Down Expand Up @@ -452,8 +452,8 @@ func (p *HelmProvider) Configure(ctx context.Context, req provider.ConfigureRequ
if !kubernetesConfig.Token.IsNull() {
kubeToken = kubernetesConfig.Token.ValueString()
}
if !kubernetesConfig.ProxyUrl.IsNull() {
kubeProxy = kubernetesConfig.ProxyUrl.ValueString()
if !kubernetesConfig.ProxyURL.IsNull() {
kubeProxy = kubernetesConfig.ProxyURL.ValueString()
}
tflog.Debug(ctx, "Config values after overrides", map[string]interface{}{
"config": config,
Expand Down Expand Up @@ -522,7 +522,7 @@ func (p *HelmProvider) Configure(ctx context.Context, req provider.ConfigureRequ
"username": types.StringValue(kubeUser),
"password": types.StringValue(kubePassword),
"insecure": types.BoolValue(kubeInsecure),
"tls_server_name": types.StringValue(kubeTlsServerName),
"tls_server_name": types.StringValue(kubeTLSServerName),
"client_certificate": types.StringValue(kubeClientCert),
"client_key": types.StringValue(kubeClientKey),
"cluster_ca_certificate": types.StringValue(kubeCaCert),
Expand Down

0 comments on commit d733054

Please sign in to comment.