Skip to content

Commit 3359b74

Browse files
authored
feat(cli): Support insecure flag for connecting to Prism (#48)
1 parent c625360 commit 3359b74

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmd/caipamx/client_params.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type clientParams struct {
1818
endpoint *url.URL
1919
username string
2020
password string
21+
insecure bool
2122
}
2223

2324
var _ client.CachedClientParams = &clientParams{}
@@ -32,6 +33,7 @@ func newClientParams() (*clientParams, error) {
3233
endpoint: endpointURL,
3334
username: viper.GetString("user"),
3435
password: viper.GetString("password"),
36+
insecure: viper.GetBool("insecure"),
3537
}, nil
3638
}
3739

@@ -42,6 +44,7 @@ func (c *clientParams) ManagementEndpoint() types.ManagementEndpoint {
4244
Username: c.username,
4345
Password: c.password,
4446
},
47+
Insecure: c.insecure,
4548
}
4649
}
4750

cmd/caipamx/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ func main() {
7272
"Cluster to reserve IPs in, either UUID or name",
7373
)
7474

75+
persistentFlags.Bool(
76+
"insecure",
77+
false,
78+
"If true, the Prism Central server certificate will not be validated.",
79+
)
80+
7581
// Bind the flags to viper
7682
must(viper.BindPFlags(persistentFlags))
7783
// Set the viper environment variable prefix to "nutanix"

0 commit comments

Comments
 (0)