Skip to content

Commit

Permalink
fix decode with tink-kubeconfig envar (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-rafraf authored Jan 2, 2025
1 parent 1e563a2 commit d269a83
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ func GetConfig(driverConfig tinktypes.TinkerbellPluginSpec, valueFromStringOrEnv
if err != nil {
return nil, fmt.Errorf(`failed to get value of "kubeconfig" field: %w`, err)
}
val, err := base64.StdEncoding.DecodeString(config.Kubeconfig)
// We intentionally ignore errors here with an assumption that an unencoded YAML or JSON must have been passed on
// in this case.
if err == nil {
config.Kubeconfig = string(val)
}
}

config.ClusterName, err = valueFromStringOrEnvVar(driverConfig.ClusterName, "CLUSTER_NAME")
if err != nil {
return nil, fmt.Errorf(`failed to get value of "clusterName" field: %w`, err)
Expand Down

0 comments on commit d269a83

Please sign in to comment.