Skip to content

Commit

Permalink
Fix Flink feature flag (#2292)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianstrauch authored Sep 21, 2023
1 parent f7864be commit dccf615
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions internal/iam/command_rbac_role_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,17 @@ func (c *roleBindingCommand) parseCommon(cmd *cobra.Command) (*roleBindingOption
/*
Helper function to add flags for all the legal scopes/clusters for the command.
*/
func addClusterFlags(cmd *cobra.Command, cfg *config.Config, cliCommand *pcmd.CLICommand, ctx *dynamicconfig.DynamicContext) {
func addClusterFlags(cmd *cobra.Command, cfg *config.Config, cliCommand *pcmd.CLICommand) {
if cfg.IsCloudLogin() {
cmd.Flags().String("environment", "", "Environment ID for scope of role-binding operation.")
cmd.Flags().Bool("current-environment", false, "Use current environment ID for scope.")
if cfg.IsTest || featureflags.Manager.BoolVariation("cli.flink.open_preview", ctx, config.CliLaunchDarklyClient, true, false) {

dc := dynamicconfig.New(cfg, nil)
_ = dc.ParseFlagsIntoConfig(cmd)
if cfg.IsTest || featureflags.Manager.BoolVariation("cli.flink.open_preview", dc.Context(), config.CliLaunchDarklyClient, true, false) {
cmd.Flags().String("flink-region", "", "Flink region ID for the role binding.")
}

cmd.Flags().String("cloud-cluster", "", "Cloud cluster ID for the role binding.")
cmd.Flags().String("kafka-cluster", "", "Kafka cluster ID for the role binding.")
cmd.Flags().String("schema-registry-cluster", "", "Schema Registry cluster ID for the role binding.")
Expand Down
2 changes: 1 addition & 1 deletion internal/iam/command_rbac_role_binding_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *roleBindingCommand) newCreateCommand() *cobra.Command {

cmd.Flags().String("role", "", "Role name of the new role binding.")
cmd.Flags().String("principal", "", "Qualified principal name for the role binding.")
addClusterFlags(cmd, c.cfg, c.CLICommand, c.Context)
addClusterFlags(cmd, c.cfg, c.CLICommand)
cmd.Flags().String("resource", "", "Qualified resource name for the role binding.")
cmd.Flags().Bool("prefix", false, "Whether the provided resource name is treated as a prefix pattern.")
pcmd.AddOutputFlag(cmd)
Expand Down
2 changes: 1 addition & 1 deletion internal/iam/command_rbac_role_binding_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (c *roleBindingCommand) newDeleteCommand() *cobra.Command {
cmd.Flags().String("role", "", "Role name of the existing role binding.")
cmd.Flags().String("principal", "", "Qualified principal name associated with the role binding.")
pcmd.AddForceFlag(cmd)
addClusterFlags(cmd, c.cfg, c.CLICommand, c.Context)
addClusterFlags(cmd, c.cfg, c.CLICommand)
cmd.Flags().String("resource", "", "Qualified resource name for the role binding.")
cmd.Flags().Bool("prefix", false, "Whether the provided resource name is treated as a prefix pattern.")
pcmd.AddOutputFlag(cmd)
Expand Down

0 comments on commit dccf615

Please sign in to comment.