From d19b8587826f9bb8e5476e0f4084a6efadc017e3 Mon Sep 17 00:00:00 2001 From: Konrad Kaim Date: Wed, 12 Nov 2025 15:42:55 +0000 Subject: [PATCH 1/5] fix: credentials retrieval --- goldens/Basic_cluster_create.txt | 2 - goldens/Batch.txt | 2 - ...Cluster_create_for_multi-host_nodepool.txt | 2 - goldens/Cluster_create_private.txt | 2 - ...h_CPU_and_memory_limits_above_capacity.txt | 2 - ...h_CPU_and_memory_limits_below_capacity.txt | 2 - goldens/Cluster_create_with_gb200-4.txt | 2 - ...Cluster_create_with_shared_reservation.txt | 2 - goldens/Job_cancel.txt | 2 - goldens/Job_list.txt | 2 - goldens/NAP_cluster-create.txt | 2 - goldens/NAP_cluster-create_with_pathways.txt | 2 - goldens/Workload_delete.txt | 2 - goldens/Workload_list.txt | 2 - src/xpk/core/cluster.py | 78 ++++++------------- src/xpk/core/cluster_test.py | 77 ++++++++++++++++++ 16 files changed, 101 insertions(+), 82 deletions(-) create mode 100644 src/xpk/core/cluster_test.py diff --git a/goldens/Basic_cluster_create.txt b/goldens/Basic_cluster_create.txt index 5b2657e3e..37e3bd1b7 100644 --- a/goldens/Basic_cluster_create.txt +++ b/goldens/Basic_cluster_create.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Batch.txt b/goldens/Batch.txt index 5b5b303cf..7045aa37d 100644 --- a/goldens/Batch.txt +++ b/goldens/Batch.txt @@ -3,13 +3,11 @@ $ xpk batch --project=golden-project --zone=us-central1-a --cluster=golden-clust [XPK] Working on golden-project and us-central1-a [XPK] Task: `Find cluster region or zone` is implemented by the following command not running since it is a dry run. gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `GKE Cluster Get ConfigMap` is implemented by the following command not running since it is a dry run. kubectl get configmap golden-cluster-resources-configmap -o=custom-columns="ConfigData:data" --no-headers=true diff --git a/goldens/Cluster_create_for_multi-host_nodepool.txt b/goldens/Cluster_create_for_multi-host_nodepool.txt index eae794c59..9eddc91ad 100644 --- a/goldens/Cluster_create_for_multi-host_nodepool.txt +++ b/goldens/Cluster_create_for_multi-host_nodepool.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_private.txt b/goldens/Cluster_create_private.txt index 7902db28f..58e012ac5 100644 --- a/goldens/Cluster_create_private.txt +++ b/goldens/Cluster_create_private.txt @@ -18,13 +18,11 @@ gcloud container clusters describe golden-cluster-private --project=golden-proje [XPK] Task: `Fetching the list of authorized network from cluster describe.` is implemented by the following command not running since it is a dry run. gcloud container clusters describe golden-cluster-private --project=golden-project --location=us-central1 --format="value(masterAuthorizedNetworksConfig.cidrBlocks[].cidrBlock)" [XPK] Current machine's IP adrress is already authorized. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster-private [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster-private` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster-private --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt index fa3b63ae5..86bc0da6a 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt index b7ce142c8..9459c10a1 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_with_gb200-4.txt b/goldens/Cluster_create_with_gb200-4.txt index 0cee708f9..0b2b4ae5b 100644 --- a/goldens/Cluster_create_with_gb200-4.txt +++ b/goldens/Cluster_create_with_gb200-4.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_with_shared_reservation.txt b/goldens/Cluster_create_with_shared_reservation.txt index 5a9555228..b9bffcfd2 100644 --- a/goldens/Cluster_create_with_shared_reservation.txt +++ b/goldens/Cluster_create_with_shared_reservation.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Job_cancel.txt b/goldens/Job_cancel.txt index e8931dc9d..e244eadb3 100644 --- a/goldens/Job_cancel.txt +++ b/goldens/Job_cancel.txt @@ -4,13 +4,11 @@ $ xpk job cancel golden-job --project=golden-project --zone=us-central1-a --clus [XPK] Working on golden-project and us-central1-a [XPK] Task: `Find cluster region or zone` is implemented by the following command not running since it is a dry run. gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `delete job` is implemented by the following command not running since it is a dry run. kubectl-kjob delete slurm golden-job diff --git a/goldens/Job_list.txt b/goldens/Job_list.txt index 53e6dadfd..a62b4e02c 100644 --- a/goldens/Job_list.txt +++ b/goldens/Job_list.txt @@ -3,13 +3,11 @@ $ xpk job ls --project=golden-project --zone=us-central1-a --cluster=golden-clus [XPK] Working on golden-project and us-central1-a [XPK] Task: `Find cluster region or zone` is implemented by the following command not running since it is a dry run. gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Listing jobs for project golden-project and zone us-central1-a: [XPK] Task: `list jobs` is implemented by the following command not running since it is a dry run. diff --git a/goldens/NAP_cluster-create.txt b/goldens/NAP_cluster-create.txt index df6d80416..8328b4bd6 100644 --- a/goldens/NAP_cluster-create.txt +++ b/goldens/NAP_cluster-create.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/NAP_cluster-create_with_pathways.txt b/goldens/NAP_cluster-create_with_pathways.txt index 2d7166f9b..fa30e9873 100644 --- a/goldens/NAP_cluster-create_with_pathways.txt +++ b/goldens/NAP_cluster-create_with_pathways.txt @@ -16,13 +16,11 @@ gcloud container clusters list --project=golden-project --filter=name=golden-clu gcloud container clusters describe golden-cluster --project=golden-project --location=us-central1 --format="value(privateClusterConfig.enablePrivateNodes)" [XPK] Private Nodes is not enabled on the cluster. [XPK] Cluster is public and no need to authorize networks. -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system [XPK] Task: `Check CoreDNS deployment in kube-system` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Workload_delete.txt b/goldens/Workload_delete.txt index 0d0ff55a9..638391bb0 100644 --- a/goldens/Workload_delete.txt +++ b/goldens/Workload_delete.txt @@ -4,13 +4,11 @@ $ xpk workload delete --project=golden-project --zone=us-central1-a --cluster=go [XPK] Working on golden-project and us-central1-a [XPK] Task: `Find cluster region or zone` is implemented by the following command not running since it is a dry run. gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `Check if PathwaysJob is installed on golden-cluster` is implemented by the following command not running since it is a dry run. kubectl get pods -n pathways-job-system --no-headers -o custom-columns=NAME:.metadata.name diff --git a/goldens/Workload_list.txt b/goldens/Workload_list.txt index c96ae2f10..92353302c 100644 --- a/goldens/Workload_list.txt +++ b/goldens/Workload_list.txt @@ -4,13 +4,11 @@ $ xpk workload list --project=golden-project --zone=us-central1-a --cluster=gold [XPK] Working on golden-project and us-central1-a [XPK] Task: `Find cluster region or zone` is implemented by the following command not running since it is a dry run. gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" -[XPK] Try 1: get-credentials-dns-endpoint to cluster golden-cluster [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default [XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods -[XPK] Credentials test succeeded. [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `List Jobs with filter-by-status=EVERYTHING with filter-by-job=None` is implemented by the following command not running since it is a dry run. kubectl get workloads --ignore-not-found -o=custom-columns="Jobset Name:.metadata.ownerReferences[0].name,Created Time:.metadata.creationTimestamp,Priority:.spec.priorityClassName,TPU VMs Needed:.spec.podSets[0].count,TPU VMs Running/Ran:.status.admission.podSetAssignments[-1].count,TPU VMs Done:.status.reclaimablePods[0].count,Status:.status.conditions[-1].type,Status Message:.status.conditions[-1].message,Status Time:.status.conditions[-1].lastTransitionTime" diff --git a/src/xpk/core/cluster.py b/src/xpk/core/cluster.py index 55848adc3..527970941 100644 --- a/src/xpk/core/cluster.py +++ b/src/xpk/core/cluster.py @@ -729,78 +729,48 @@ def update_cluster_with_gcsfuse_driver_if_necessary(args) -> int: return 0 -def test_and_retry_credentials_with_dns_logic(args) -> int: - """Tests kubectl credentials and retries with default settings if a DNS error is found. +def get_cluster_credentials(args) -> int: + """Run cluster configuration command to set the kubectl config. Args: args: user provided arguments for running the command. Returns: - 0 if credentials are valid after retrying, 1 otherwise. + 0 if successful and 1 otherwise. """ + location = get_cluster_location(args.project, args.cluster, args.zone) - xpk_print('Testing credentials with kubectl...') - kubectl_command = 'kubectl get pods' - kubectl_return_code, kubectl_output = run_command_for_value( - kubectl_command, 'kubectl get pods' - ) - if kubectl_return_code == 0: - xpk_print('Credentials test succeeded.') - return 0 + _get_credentials(args.project, args.cluster, location, dns_endpoint=True) - dns_endpoint_error = ( - 'control_plane_endpoints_config.dns_endpoint_config.allow_external_traffic' - ' is disabled' - ) - if dns_endpoint_error not in kubectl_output: - xpk_print(f'kubectl failed with an unhandled error: {kubectl_output}') - xpk_exit(kubectl_return_code) - xpk_print( - 'Detected DNS endpoint-related error. Retrying without --dns-endpoint' - ' flag...' - ) + xpk_print('Testing credentials with kubectl...') + if not _are_credentials_valid(): + xpk_print('Detected error. Retrying without --dns-endpoint flag...') + _get_credentials(args.project, args.cluster, location, dns_endpoint=False) - location = get_cluster_location(args.project, args.cluster, args.zone) - without_dns_command = ( - 'gcloud container clusters get-credentials' - f' {args.cluster} --location={location}' - f' --project={args.project} &&' - ' kubectl config view && kubectl config set-context --current' - ' --namespace=default' - ) - return_code = run_command_with_updates( - without_dns_command, 'get-credentials to cluster', verbose=False - ) - if return_code != 0: - xpk_print('Failed to get credentials even without --dns-endpoint. Exiting.') - xpk_exit(return_code) + xpk_print('Finished get-credentials and kubectl setup.') return 0 -def get_cluster_credentials(args) -> int: - """Run cluster configuration command to set the kubectl config. - - Args: - args: user provided arguments for running the command. - - Returns: - 0 if successful and 1 otherwise. - """ - location = get_cluster_location(args.project, args.cluster, args.zone) +def _get_credentials( + project: str, cluster: str, location: str, dns_endpoint: bool +): + dns_endpoint_arg = '--dns-endpoint' if dns_endpoint else '' command = ( 'gcloud container clusters get-credentials' - f' {args.cluster} --location={location} --dns-endpoint' - f' --project={args.project} && kubectl config view && kubectl config' + f' {cluster} --location={location} {dns_endpoint_arg}' + f' --project={project} && kubectl config view && kubectl config' ' set-context --current --namespace=default' ) - task = f'get-credentials-dns-endpoint to cluster {args.cluster}' - return_code = run_command_with_updates_retry(command, task, verbose=False) - + task = f'get-credentials-dns-endpoint to cluster {cluster}' + return_code = run_command_with_updates(command, task, verbose=False) if return_code != 0: xpk_print(f'{task} returned ERROR {return_code}') xpk_exit(return_code) - return_code = test_and_retry_credentials_with_dns_logic(args) - xpk_print('Finished get-credentials and kubectl setup.') - return return_code +def _are_credentials_valid() -> bool: + kubectl_command = 'kubectl get pods' + kubectl_return_code, _ = run_command_for_value( + kubectl_command, 'kubectl get pods' + ) + return kubectl_return_code == 0 diff --git a/src/xpk/core/cluster_test.py b/src/xpk/core/cluster_test.py new file mode 100644 index 000000000..f19720b5e --- /dev/null +++ b/src/xpk/core/cluster_test.py @@ -0,0 +1,77 @@ +""" +Copyright 2025 Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import pytest +from .testing.commands_tester import CommandsTester +from .cluster import get_cluster_credentials +from pytest_mock import MockerFixture + + +@pytest.fixture(autouse=True) +def commands_tester(mocker: MockerFixture) -> CommandsTester: + return CommandsTester( + mocker=mocker, + run_command_for_value_path="xpk.core.cluster.run_command_for_value", + run_command_with_updates_path="xpk.core.cluster.run_command_with_updates", + ) + + +@pytest.fixture(autouse=True) +def mock_location(mocker: MockerFixture): + mocker.patch( + "xpk.core.cluster.get_cluster_location", return_value="us-central1" + ) + + +@pytest.fixture(autouse=True) +def command_args(mocker: MockerFixture): + return mocker.Mock(cluster="cluster", project="project", zone="zone") + + +def test_get_cluster_credentials_does_not_retry_with_dns_when_retrieval_succeeds( + commands_tester: CommandsTester, command_args +): + commands_tester.set_result_for_command( + (0, ""), "gcloud container clusters get-credentials --dns-endpoint" + ) + commands_tester.set_result_for_command((0, ""), "kubectl get pods") + get_cluster_credentials(command_args) + non_dns_endpoint_commands = [ + c + for c in commands_tester.get_matching_commands( + "gcloud container clusters get-credentials" + ) + if "dns-endpoint" not in c + ] + assert len(non_dns_endpoint_commands) == 0 + + +def test_get_cluster_credentials_retries_without_dns_when_dns_retrieval_fails( + commands_tester: CommandsTester, command_args +): + commands_tester.set_result_for_command( + (0, ""), "gcloud container clusters get-credentials --dns-endpoint" + ) + commands_tester.set_result_for_command((1, ""), "kubectl get pods") + get_cluster_credentials(command_args) + non_dns_endpoint_commands = [ + c + for c in commands_tester.get_matching_commands( + "gcloud container clusters get-credentials" + ) + if "dns-endpoint" not in c + ] + assert len(non_dns_endpoint_commands) == 1 From 73c04f2278cde614367cd9db22d1ec0fbaf01cd2 Mon Sep 17 00:00:00 2001 From: Konrad Kaim Date: Thu, 13 Nov 2025 08:23:09 +0000 Subject: [PATCH 2/5] fix: peer review fixes --- src/xpk/core/cluster.py | 28 +++++++++++++++++++--------- src/xpk/core/cluster_test.py | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/xpk/core/cluster.py b/src/xpk/core/cluster.py index 527970941..54066a99e 100644 --- a/src/xpk/core/cluster.py +++ b/src/xpk/core/cluster.py @@ -740,12 +740,25 @@ def get_cluster_credentials(args) -> int: """ location = get_cluster_location(args.project, args.cluster, args.zone) - _get_credentials(args.project, args.cluster, location, dns_endpoint=True) + return_code = _get_credentials( + project=args.project, + cluster=args.cluster, + location=location, + dns_endpoint=True, + ) + if return_code != 0: + return return_code - xpk_print('Testing credentials with kubectl...') if not _are_credentials_valid(): xpk_print('Detected error. Retrying without --dns-endpoint flag...') - _get_credentials(args.project, args.cluster, location, dns_endpoint=False) + return_code = _get_credentials( + project=args.project, + cluster=args.cluster, + location=location, + dns_endpoint=False, + ) + if return_code != 0: + return return_code xpk_print('Finished get-credentials and kubectl setup.') return 0 @@ -753,7 +766,7 @@ def get_cluster_credentials(args) -> int: def _get_credentials( project: str, cluster: str, location: str, dns_endpoint: bool -): +) -> int: dns_endpoint_arg = '--dns-endpoint' if dns_endpoint else '' command = ( 'gcloud container clusters get-credentials' @@ -762,15 +775,12 @@ def _get_credentials( ' set-context --current --namespace=default' ) task = f'get-credentials-dns-endpoint to cluster {cluster}' - return_code = run_command_with_updates(command, task, verbose=False) - if return_code != 0: - xpk_print(f'{task} returned ERROR {return_code}') - xpk_exit(return_code) + return run_command_with_updates(command, task, verbose=False) def _are_credentials_valid() -> bool: kubectl_command = 'kubectl get pods' - kubectl_return_code, _ = run_command_for_value( + kubectl_return_code = run_command_with_updates( kubectl_command, 'kubectl get pods' ) return kubectl_return_code == 0 diff --git a/src/xpk/core/cluster_test.py b/src/xpk/core/cluster_test.py index f19720b5e..2d87ba9bd 100644 --- a/src/xpk/core/cluster_test.py +++ b/src/xpk/core/cluster_test.py @@ -41,6 +41,24 @@ def command_args(mocker: MockerFixture): return mocker.Mock(cluster="cluster", project="project", zone="zone") +def test_get_cluster_credentials_returns_1_when_retrieval_command_fails( + commands_tester: CommandsTester, command_args +): + commands_tester.set_result_for_command( + (1, ""), "gcloud container clusters get-credentials" + ) + assert get_cluster_credentials(command_args) == 1 + + +def test_get_cluster_credentials_returns_0_when_retrieval_succeeds( + commands_tester: CommandsTester, command_args +): + commands_tester.set_result_for_command( + (0, ""), "gcloud container clusters get-credentials" + ) + assert get_cluster_credentials(command_args) == 0 + + def test_get_cluster_credentials_does_not_retry_with_dns_when_retrieval_succeeds( commands_tester: CommandsTester, command_args ): From 7a6039478c9196459c303af6ca5841d4b6cbe661 Mon Sep 17 00:00:00 2001 From: Konrad Kaim Date: Thu, 13 Nov 2025 08:31:08 +0000 Subject: [PATCH 3/5] update goldens --- goldens/Basic_cluster_create.txt | 1 - goldens/Batch.txt | 1 - goldens/Cluster_create_for_multi-host_nodepool.txt | 1 - goldens/Cluster_create_private.txt | 1 - .../Cluster_create_with_CPU_and_memory_limits_above_capacity.txt | 1 - .../Cluster_create_with_CPU_and_memory_limits_below_capacity.txt | 1 - goldens/Cluster_create_with_gb200-4.txt | 1 - goldens/Cluster_create_with_shared_reservation.txt | 1 - goldens/Job_cancel.txt | 1 - goldens/Job_list.txt | 1 - goldens/NAP_cluster-create.txt | 1 - goldens/NAP_cluster-create_with_pathways.txt | 1 - goldens/Workload_delete.txt | 1 - goldens/Workload_list.txt | 1 - 14 files changed, 14 deletions(-) diff --git a/goldens/Basic_cluster_create.txt b/goldens/Basic_cluster_create.txt index 37e3bd1b7..e71639dc4 100644 --- a/goldens/Basic_cluster_create.txt +++ b/goldens/Basic_cluster_create.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Batch.txt b/goldens/Batch.txt index 7045aa37d..fece6c2b5 100644 --- a/goldens/Batch.txt +++ b/goldens/Batch.txt @@ -5,7 +5,6 @@ $ xpk batch --project=golden-project --zone=us-central1-a --cluster=golden-clust gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_for_multi-host_nodepool.txt b/goldens/Cluster_create_for_multi-host_nodepool.txt index 9eddc91ad..4e820041e 100644 --- a/goldens/Cluster_create_for_multi-host_nodepool.txt +++ b/goldens/Cluster_create_for_multi-host_nodepool.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_private.txt b/goldens/Cluster_create_private.txt index 58e012ac5..969abcb50 100644 --- a/goldens/Cluster_create_private.txt +++ b/goldens/Cluster_create_private.txt @@ -20,7 +20,6 @@ gcloud container clusters describe golden-cluster-private --project=golden-proje [XPK] Current machine's IP adrress is already authorized. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster-private` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster-private --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt index 86bc0da6a..214c0bb72 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt index 9459c10a1..75648b135 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_with_gb200-4.txt b/goldens/Cluster_create_with_gb200-4.txt index 0b2b4ae5b..8e897f27a 100644 --- a/goldens/Cluster_create_with_gb200-4.txt +++ b/goldens/Cluster_create_with_gb200-4.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Cluster_create_with_shared_reservation.txt b/goldens/Cluster_create_with_shared_reservation.txt index b9bffcfd2..d77c9cf3b 100644 --- a/goldens/Cluster_create_with_shared_reservation.txt +++ b/goldens/Cluster_create_with_shared_reservation.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Job_cancel.txt b/goldens/Job_cancel.txt index e244eadb3..eb99c6c6f 100644 --- a/goldens/Job_cancel.txt +++ b/goldens/Job_cancel.txt @@ -6,7 +6,6 @@ $ xpk job cancel golden-job --project=golden-project --zone=us-central1-a --clus gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Job_list.txt b/goldens/Job_list.txt index a62b4e02c..792e57c15 100644 --- a/goldens/Job_list.txt +++ b/goldens/Job_list.txt @@ -5,7 +5,6 @@ $ xpk job ls --project=golden-project --zone=us-central1-a --cluster=golden-clus gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/NAP_cluster-create.txt b/goldens/NAP_cluster-create.txt index 8328b4bd6..1ae4c4410 100644 --- a/goldens/NAP_cluster-create.txt +++ b/goldens/NAP_cluster-create.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/NAP_cluster-create_with_pathways.txt b/goldens/NAP_cluster-create_with_pathways.txt index fa30e9873..b4d578350 100644 --- a/goldens/NAP_cluster-create_with_pathways.txt +++ b/goldens/NAP_cluster-create_with_pathways.txt @@ -18,7 +18,6 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Workload_delete.txt b/goldens/Workload_delete.txt index 638391bb0..97d691388 100644 --- a/goldens/Workload_delete.txt +++ b/goldens/Workload_delete.txt @@ -6,7 +6,6 @@ $ xpk workload delete --project=golden-project --zone=us-central1-a --cluster=go gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. diff --git a/goldens/Workload_list.txt b/goldens/Workload_list.txt index 92353302c..b2f8c626b 100644 --- a/goldens/Workload_list.txt +++ b/goldens/Workload_list.txt @@ -6,7 +6,6 @@ $ xpk workload list --project=golden-project --zone=us-central1-a --cluster=gold gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Testing credentials with kubectl... [XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. From dfe6c2a0642a478ff2cbc9c3fe2685aaa6bb6e85 Mon Sep 17 00:00:00 2001 From: Konrad Kaim Date: Thu, 13 Nov 2025 08:42:04 +0000 Subject: [PATCH 4/5] feat: update task name --- src/xpk/core/cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xpk/core/cluster.py b/src/xpk/core/cluster.py index 54066a99e..5f520fc89 100644 --- a/src/xpk/core/cluster.py +++ b/src/xpk/core/cluster.py @@ -781,6 +781,6 @@ def _get_credentials( def _are_credentials_valid() -> bool: kubectl_command = 'kubectl get pods' kubectl_return_code = run_command_with_updates( - kubectl_command, 'kubectl get pods' + kubectl_command, 'Test kubectl credentials' ) return kubectl_return_code == 0 From ef9cdc8046f9d302a1ff6cfb2d09fa942fe6dc36 Mon Sep 17 00:00:00 2001 From: Konrad Kaim Date: Thu, 13 Nov 2025 08:43:10 +0000 Subject: [PATCH 5/5] update goldens --- goldens/Basic_cluster_create.txt | 2 +- goldens/Batch.txt | 2 +- goldens/Cluster_create_for_multi-host_nodepool.txt | 2 +- goldens/Cluster_create_private.txt | 2 +- ...Cluster_create_with_CPU_and_memory_limits_above_capacity.txt | 2 +- ...Cluster_create_with_CPU_and_memory_limits_below_capacity.txt | 2 +- goldens/Cluster_create_with_gb200-4.txt | 2 +- goldens/Cluster_create_with_shared_reservation.txt | 2 +- goldens/Job_cancel.txt | 2 +- goldens/Job_list.txt | 2 +- goldens/NAP_cluster-create.txt | 2 +- goldens/NAP_cluster-create_with_pathways.txt | 2 +- goldens/Workload_delete.txt | 2 +- goldens/Workload_list.txt | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/goldens/Basic_cluster_create.txt b/goldens/Basic_cluster_create.txt index e71639dc4..e994df8f4 100644 --- a/goldens/Basic_cluster_create.txt +++ b/goldens/Basic_cluster_create.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Batch.txt b/goldens/Batch.txt index fece6c2b5..8f327e2ac 100644 --- a/goldens/Batch.txt +++ b/goldens/Batch.txt @@ -5,7 +5,7 @@ $ xpk batch --project=golden-project --zone=us-central1-a --cluster=golden-clust gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `GKE Cluster Get ConfigMap` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Cluster_create_for_multi-host_nodepool.txt b/goldens/Cluster_create_for_multi-host_nodepool.txt index 4e820041e..8342cd965 100644 --- a/goldens/Cluster_create_for_multi-host_nodepool.txt +++ b/goldens/Cluster_create_for_multi-host_nodepool.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Cluster_create_private.txt b/goldens/Cluster_create_private.txt index 969abcb50..720d7d40a 100644 --- a/goldens/Cluster_create_private.txt +++ b/goldens/Cluster_create_private.txt @@ -20,7 +20,7 @@ gcloud container clusters describe golden-cluster-private --project=golden-proje [XPK] Current machine's IP adrress is already authorized. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster-private` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster-private --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt index 214c0bb72..623646ced 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_above_capacity.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt index 75648b135..c628158bc 100644 --- a/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt +++ b/goldens/Cluster_create_with_CPU_and_memory_limits_below_capacity.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Cluster_create_with_gb200-4.txt b/goldens/Cluster_create_with_gb200-4.txt index 8e897f27a..8a9d674c0 100644 --- a/goldens/Cluster_create_with_gb200-4.txt +++ b/goldens/Cluster_create_with_gb200-4.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Cluster_create_with_shared_reservation.txt b/goldens/Cluster_create_with_shared_reservation.txt index d77c9cf3b..c880a29e7 100644 --- a/goldens/Cluster_create_with_shared_reservation.txt +++ b/goldens/Cluster_create_with_shared_reservation.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Job_cancel.txt b/goldens/Job_cancel.txt index eb99c6c6f..ec8946781 100644 --- a/goldens/Job_cancel.txt +++ b/goldens/Job_cancel.txt @@ -6,7 +6,7 @@ $ xpk job cancel golden-job --project=golden-project --zone=us-central1-a --clus gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `delete job` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Job_list.txt b/goldens/Job_list.txt index 792e57c15..9c86c3955 100644 --- a/goldens/Job_list.txt +++ b/goldens/Job_list.txt @@ -5,7 +5,7 @@ $ xpk job ls --project=golden-project --zone=us-central1-a --cluster=golden-clus gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Listing jobs for project golden-project and zone us-central1-a: diff --git a/goldens/NAP_cluster-create.txt b/goldens/NAP_cluster-create.txt index 1ae4c4410..8bb28a4f3 100644 --- a/goldens/NAP_cluster-create.txt +++ b/goldens/NAP_cluster-create.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/NAP_cluster-create_with_pathways.txt b/goldens/NAP_cluster-create_with_pathways.txt index b4d578350..ca028dc1a 100644 --- a/goldens/NAP_cluster-create_with_pathways.txt +++ b/goldens/NAP_cluster-create_with_pathways.txt @@ -18,7 +18,7 @@ gcloud container clusters describe golden-cluster --project=golden-project --loc [XPK] Cluster is public and no need to authorize networks. [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: 'Checking CoreDNS deployment existence' in progress for namespace: kube-system diff --git a/goldens/Workload_delete.txt b/goldens/Workload_delete.txt index 97d691388..e9e70492f 100644 --- a/goldens/Workload_delete.txt +++ b/goldens/Workload_delete.txt @@ -6,7 +6,7 @@ $ xpk workload delete --project=golden-project --zone=us-central1-a --cluster=go gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `Check if PathwaysJob is installed on golden-cluster` is implemented by the following command not running since it is a dry run. diff --git a/goldens/Workload_list.txt b/goldens/Workload_list.txt index b2f8c626b..f3762652d 100644 --- a/goldens/Workload_list.txt +++ b/goldens/Workload_list.txt @@ -6,7 +6,7 @@ $ xpk workload list --project=golden-project --zone=us-central1-a --cluster=gold gcloud container clusters list --project=golden-project --filter=name=golden-cluster --format="value(location)" [XPK] Task: `get-credentials-dns-endpoint to cluster golden-cluster` is implemented by the following command not running since it is a dry run. gcloud container clusters get-credentials golden-cluster --location=us-central1 --dns-endpoint --project=golden-project && kubectl config view && kubectl config set-context --current --namespace=default -[XPK] Task: `kubectl get pods` is implemented by the following command not running since it is a dry run. +[XPK] Task: `Test kubectl credentials` is implemented by the following command not running since it is a dry run. kubectl get pods [XPK] Finished get-credentials and kubectl setup. [XPK] Task: `List Jobs with filter-by-status=EVERYTHING with filter-by-job=None` is implemented by the following command not running since it is a dry run.