diff --git a/src/connectedk8s/azext_connectedk8s/_constants.py b/src/connectedk8s/azext_connectedk8s/_constants.py index 485075e5d39..62ed0fdca41 100644 --- a/src/connectedk8s/azext_connectedk8s/_constants.py +++ b/src/connectedk8s/azext_connectedk8s/_constants.py @@ -118,7 +118,6 @@ Operate_RG_Cluster_Name_Conflict = 'The provided cluster name and rg correspond to different cluster being operated on' Custom_Locations_Registration_Check_Fault_Type = "Error while checking resource provider registration of custom locations." Custom_Locations_OID_Fetch_Fault_Type = "Error while fetching oid for custom locations." -Application_Details_Not_Provided_For_Azure_RBAC_Fault = 'Application ID or secret not provided for Azure RBAC' Successfully_Enabled_Features = 'Successsfully enabled features: {} for the Connected Cluster {}' Successfully_Disabled_Features = 'Successsfully disabled features: {} for the Connected Cluster {}' Error_enabling_Features = 'Error while updating agents for enabling features. Please run \"kubectl get pods -n azure-arc\" to check the pods in case of timeout error. Error: {}' diff --git a/src/connectedk8s/azext_connectedk8s/_help.py b/src/connectedk8s/azext_connectedk8s/_help.py index 2fbb29b112b..7fdb2fdf63b 100644 --- a/src/connectedk8s/azext_connectedk8s/_help.py +++ b/src/connectedk8s/azext_connectedk8s/_help.py @@ -109,7 +109,7 @@ - name: Enables the Cluster-Connect feature. text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features cluster-connect - name: Enable Azure RBAC feature. - text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features azure-rbac --app-id appID --app-secret="appSecret" --skip-azure-rbac-list "user1@domain.com,spn_oid" + text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features azure-rbac --skip-azure-rbac-list "user1@domain.com,spn_oid" - name: Enable multiple features. text: az connectedk8s enable-features -n clusterName -g resourceGroupName --features cluster-connect custom-locations """ diff --git a/src/connectedk8s/azext_connectedk8s/_params.py b/src/connectedk8s/azext_connectedk8s/_params.py index 042b4d2081b..d2b21eff1c9 100644 --- a/src/connectedk8s/azext_connectedk8s/_params.py +++ b/src/connectedk8s/azext_connectedk8s/_params.py @@ -80,8 +80,6 @@ def load_arguments(self, _): c.argument('kube_config', options_list=['--kube-config'], help='Path to the kube config file.') c.argument('kube_context', options_list=['--kube-context'], help='Kubconfig context from current machine.') c.argument('features', features_types, options_list=['--features'], help='Space-separated list of features you want to enable.') - c.argument('azrbac_client_id', options_list=['--app-id'], arg_group='Azure RBAC', help='Application ID for enabling Azure RBAC. Specify when enabling azure-rbac.') - c.argument('azrbac_client_secret', options_list=['--app-secret'], arg_group='Azure RBAC', help='Application secret for enabling Azure RBAC. Specify when enabling azure-rbac.') c.argument('azrbac_skip_authz_check', options_list=['--skip-azure-rbac-list'], arg_group='Azure RBAC', help='Comma separated list of names of usernames/email/oid. Azure RBAC will be skipped for these users. Specify when enabling azure-rbac.') c.argument('cl_oid', options_list=['--custom-locations-oid'], help="OID of 'custom-locations' app") diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 12fe991e492..a6bfe3560a4 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1351,7 +1351,7 @@ def get_all_helm_values(release_namespace, kube_config, kube_context, helm_clien def enable_features(cmd, client, resource_group_name, cluster_name, features, kube_config=None, kube_context=None, - azrbac_client_id=None, azrbac_client_secret=None, azrbac_skip_authz_check=None, cl_oid=None): + azrbac_skip_authz_check=None, cl_oid=None): logger.warning("This operation might take a while...\n") # Validate custom token operation diff --git a/src/connectedk8s/azext_connectedk8s/tests/latest/test_connectedk8s_scenario.py b/src/connectedk8s/azext_connectedk8s/tests/latest/test_connectedk8s_scenario.py index e7c881e72ac..dc644728d6c 100644 --- a/src/connectedk8s/azext_connectedk8s/tests/latest/test_connectedk8s_scenario.py +++ b/src/connectedk8s/azext_connectedk8s/tests/latest/test_connectedk8s_scenario.py @@ -270,7 +270,7 @@ def test_enable_disable_features(self,resource_group): assert(enabled_cmd1["systemDefaultValues"]['customLocations']['enabled'] == bool(1)) assert(enabled_cmd1["systemDefaultValues"]['clusterconnect-agent']['enabled'] == bool(1)) - # scenario-4: azure rbac turned off and turning azure rbac on again using app id and app secret + # scenario-4: azure rbac turned off and turning azure rbac on again using 1P self.cmd('connectedk8s disable-features -n {name} -g {rg} --features azure-rbac --kube-config {kubeconfig} --kube-context {managed_cluster_name}-admin -y') cmd_output1 = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE) _, error_helm_delete = cmd_output1.communicate() @@ -278,7 +278,7 @@ def test_enable_disable_features(self,resource_group): disabled_cmd1 = json.loads(cmd_output1.communicate()[0].strip()) assert(disabled_cmd1["systemDefaultValues"]['guard']['enabled'] == bool(0)) - self.cmd('az connectedk8s enable-features -n {name} -g {rg} --kube-config {kubeconfig} --kube-context {managed_cluster_name}-admin --features azure-rbac --app-id ffba4043-836e-4dcc-906c-fbf60bf54eef --app-secret="6a6ae7a7-4260-40d3-ba00-af909f2ca8f0"') + self.cmd('az connectedk8s enable-features -n {name} -g {rg} --kube-config {kubeconfig} --kube-context {managed_cluster_name}-admin --features azure-rbac') # deleting the cluster self.cmd('connectedk8s delete -g {rg} -n {name} --kube-config {kubeconfig} --kube-context {managed_cluster_name}-admin -y')