Skip to content

Commit b8f4fb3

Browse files
fix: bind env correctly
1 parent cc5965d commit b8f4fb3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/ctrlc/ctrlc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ func init() {
3131
cmd.PersistentFlags().String("workspace", "", "Ctrlplane Workspace ID")
3232
viper.BindPFlag("workspace", cmd.PersistentFlags().Lookup("workspace"))
3333
viper.BindEnv("workspace", "CTRLPLANE_WORKSPACE")
34+
35+
viper.BindEnv("cluster-identifier", "CTRLPLANE_CLUSTER_IDENTIFIER")
3436
}
3537

3638
func main() {

cmd/ctrlc/root/sync/kubernetes/vcluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ func NewSyncVclusterCmd() *cobra.Command {
115115
workspaceId := viper.GetString("workspace")
116116

117117
if clusterIdentifier == "" {
118-
clusterIdentifier = viper.GetString("cluster_identifier")
118+
clusterIdentifier = viper.GetString("cluster-identifier")
119119
}
120120

121121
if clusterIdentifier == "" {
122-
return fmt.Errorf("cluster identifier is required, please set the CLUSTER_IDENTIFIER environment variable or use the --cluster-identifier flag")
122+
return fmt.Errorf("cluster identifier is required, please set the CTRLPLANE_CLUSTER_IDENTIFIER environment variable or use the --cluster-identifier flag")
123123
}
124124

125125
ctrlplaneClient, err := api.NewAPIKeyClientWithResponses(apiURL, apiKey)

0 commit comments

Comments
 (0)