Skip to content

Commit 0f92c2b

Browse files
authored
Fix Workload Identity check by stripping newlines (#1194)
The gcloud container clusters describe command returns the workload pool with a trailing newline. Without stripping it, the comparison with the expected workload pool fails, causing XPK to attempt to update the GKE cluster even if Workload Identity is already enabled.
1 parent b920bd4 commit 0f92c2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/xpk/core/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def is_workload_identity_enabled_on_cluster(args) -> bool:
655655
)
656656
if return_code != 0:
657657
xpk_exit(return_code)
658-
if workload_pool == f'{args.project}.svc.id.goog':
658+
if workload_pool.strip() == f'{args.project}.svc.id.goog':
659659
xpk_print(
660660
'Workload Identity Federation is enabled on the cluster, no update'
661661
' needed.'

0 commit comments

Comments
 (0)