Skip to content

fix: Stop StatusWatcher on Forbidden API error#585

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
karlkfi:karl-watch-perm-error
May 17, 2022
Merged

fix: Stop StatusWatcher on Forbidden API error#585
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
karlkfi:karl-watch-perm-error

Conversation

@karlkfi
Copy link
Copy Markdown
Contributor

@karlkfi karlkfi commented May 17, 2022

  • This matches previous StatusPoller behavior which would error
    and exit if there was a 403 Forbidden error from the apiserver.
  • Handle status error before synchronization with immediate exit

Without this fix, the StatusWatcher gets stuck in an endless retry loop until cancelled or permission is granted, printing the following warning:

W0516 21:03:57.305558 13045 reflector.go:324] pkg/mod/k8s.io/client-go@v0.24.0/tools/cache/reflector.go:167: failed to list /v1, Kind=ConfigMap: configmaps is forbidden: User "system:serviceaccount:default:user" cannot list resource "configmaps" in API group "" at the cluster scope

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 17, 2022
@k8s-ci-robot k8s-ci-robot requested review from mortent and seans3 May 17, 2022 01:09
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 17, 2022
@karlkfi karlkfi requested review from Liujingfang1 and removed request for seans3 May 17, 2022 01:09
@karlkfi karlkfi force-pushed the karl-watch-perm-error branch from 2d3c932 to e7dc126 Compare May 17, 2022 01:29
@karlkfi karlkfi force-pushed the karl-watch-perm-error branch from e7dc126 to 669f498 Compare May 17, 2022 20:31
@Liujingfang1
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2022
- This matches previous StatusPoller behavior which would error
  and exit if there was a 403 Forbidden error from the apiserver.
- Handle status error before synchronization with immediate exit
@karlkfi karlkfi force-pushed the karl-watch-perm-error branch from 669f498 to 57bbe71 Compare May 17, 2022 21:24
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2022
@janetkuo
Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2022
@Liujingfang1
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: karlkfi, Liujingfang1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 17, 2022
@k8s-ci-robot k8s-ci-robot merged commit 0cb95ee into kubernetes-sigs:master May 17, 2022
@karlkfi karlkfi deleted the karl-watch-perm-error branch May 17, 2022 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants