2323 ctx_update , set_cluster_id , get_cluster_id , get_project_id , \
2424 get_template , get_cluster_name , format_changed_row , \
2525 is_interesting_status , profile_completer , project_completer , \
26- kubeconfig_parse_fields , print_table , format_row
26+ kubeconfig_parse_fields , print_table , format_row , apply_set_fields
2727
2828from .profile import add_profile
2929from .project import project_create , project_login
@@ -371,8 +371,9 @@ def _create_cluster(project_name, cluster_config, output):
371371@click .option ('--output' , '-o' , type = click .Choice (["json" , "yaml" ]), help = "Specify output format, by default is json" )
372372@click .option ('--filename' , '-f' , type = click .File ("r" ), help = "Path to file to use to create the cluster " )
373373@click .option ('--profile' , help = "Configuration profile to use" , shell_complete = profile_completer )
374+ @click .option ('--set' , 'set_fields' , multiple = True , help = "Set arbitrary nested fields, e.g. auth.oidc.issuer-url=value" )
374375@click .pass_context
375- def cluster_create_command (ctx , project_name , cluster_name , description , admin , version , cidr_pods , cidr_service , control_plane , zone , enable_admission_plugins , disable_admission_plugins , quirk , tags , disable_api_termination , cp_multi_az , dry_run , output , filename , profile ):
376+ def cluster_create_command (ctx , project_name , cluster_name , description , admin , version , cidr_pods , cidr_service , control_plane , zone , enable_admission_plugins , disable_admission_plugins , quirk , tags , disable_api_termination , cp_multi_az , dry_run , output , filename , profile , set_fields ):
376377 """CLI command to create a new Kubernetes cluster with optional configuration parameters."""
377378 project_name , cluster_name , profile = ctx_update (ctx , project_name , cluster_name , profile )
378379 login_profile (profile )
@@ -443,6 +444,8 @@ def cluster_create_command(ctx, project_name, cluster_name, description, admin,
443444 if cp_multi_az is not None :
444445 cluster_config ["cp_multi_az" ] = cp_multi_az
445446
447+ apply_set_fields (cluster_config , set_fields )
448+
446449 if not dry_run :
447450 _create_cluster (project_name , cluster_config , output )
448451 else :
@@ -466,8 +469,9 @@ def cluster_create_command(ctx, project_name, cluster_name, description, admin,
466469@click .option ('--output' , '-o' , type = click .Choice (["json" , "yaml" ]), help = "Specify output format, by default is json" )
467470@click .option ('--filename' , '-f' , type = click .File ("r" ), help = "Path to file to use to update the cluster " )
468471@click .option ('--profile' , help = "Configuration profile to use" , shell_complete = profile_completer )
472+ @click .option ('--set' , 'set_fields' , multiple = True , help = "Set arbitrary nested fields, e.g. auth.oidc.issuer-url=value" )
469473@click .pass_context
470- def cluster_update_command (ctx , project_name , cluster_name , description , admin , version , tags , enable_admission_plugins , disable_admission_plugins , quirk , disable_api_termination , control_plane , dry_run , output , filename , profile ):
474+ def cluster_update_command (ctx , project_name , cluster_name , description , admin , version , tags , enable_admission_plugins , disable_admission_plugins , quirk , disable_api_termination , control_plane , dry_run , output , filename , profile , set_fields ):
471475 """CLI command to update an existing Kubernetes cluster with new configuration options."""
472476 project_name , cluster_name , profile = ctx_update (ctx , project_name , cluster_name , profile )
473477 login_profile (profile )
@@ -545,6 +549,8 @@ def cluster_update_command(ctx, project_name, cluster_name, description, admin,
545549
546550 if control_plane :
547551 cluster_config ['control_planes' ] = control_plane
552+
553+ apply_set_fields (cluster_config , set_fields )
548554
549555 if dry_run :
550556 print_output (cluster_config , output )
0 commit comments