fix(#943): handle GCP PSC clusters in break-glass cleanup - #944
fix(#943): handle GCP PSC clusters in break-glass cleanup#944fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
The cleanup command only checked for AWS PrivateLink clusters when deciding whether to delete jump pods on hive. GCP Private Service Connect (PSC) clusters also use jump pods (created by the access command which already handles PSC), but cleanup treated them as non-PrivateLink and only unset KUBECONFIG instead. Add the same PSC detection used in access.go to cleanup.go so PSC clusters are routed to dropPrivateLinkAccess. Update command descriptions, error messages, and log output to reference PSC alongside PrivateLink. Fix pre-existing typo (usualy -> usually) and unnecessary fmt.Sprintf on lines touched by this change. Add generatePSCClusterObjectForTesting helper and a dedicated PSC test suite mirroring the existing PrivateLink cleanup tests. Closes #943
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fullsend-ai-coder[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @fullsend-ai-coder[bot]. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
@fullsend-ai-coder[bot]: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
dropPrivateLinkAccessto delete jump pods on hive instead of only unsettingKUBECONFIGRoot Cause
The
cleanup.goRunmethod only checkedcluster.AWS().PrivateLink()to decide whether to delete jump pods. Theaccess.goRunmethod additionally checkscluster.GCP().PrivateServiceConnect().ServiceAttachmentSubnet() != ""for PSC clusters. This mismatch meant PSC clusters got jump pods created during break-glass but cleanup treated them as non-PrivateLink, leaving orphaned pods on hive.Changes
cmd/cluster/access/cleanup.go: Added PSC check (isPscCluster) to theRunmethod, updatedLongdescription,reasonflag help text, error/log messages indropPrivateLinkAccess, and fixed pre-existing typo and unnecessaryfmt.Sprintfon touched linescmd/cluster/access/access_test.go: AddedgeneratePSCClusterObjectForTestinghelper functioncmd/cluster/access/cleanup_test.go: AddedTestCleanupAccessOptions_dropPrivateLinkAccess_PSCClustertest suite covering single pod, no pods, and mixed pod scenariosTesting
go vetandgolangci-lintpass with zero issuesCloses #943
Post-script verification
agent/943-psc-cleanup-fix)13f62d5fbd5f130e861aa956a4709499d18144e9..HEAD)