Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WebHook controller crashing on minishift #572

Merged
merged 1 commit into from
Mar 1, 2019

Conversation

sthaha
Copy link
Member

@sthaha sthaha commented Mar 1, 2019

Installing tekton on minishift fails to bring up webhook-controller pod
due missing RBAC policy. Pod logs shows the following error

{
  "level":"error",
  "logger":"webhook",
  "caller":"webhook/webhook.go:310" ,
  "msg":"failed to register webhook"
  "knative.dev/controller":"webhook"
  "error":"failed to create a webhook: mutatingwebhookconfigurations.admissionregistration.k8s.io
      \"webhook.tekton.dev\" is forbidden:
      cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: no RBAC policy matched
 "
"stacktrace":"
  github.com/knative/build-pipeline/vendor/github.com/knative/pkg/webhook.(*AdmissionController).Run
      /usr/local/google/home/jasonhall/go/src/github.com/knative/build-pipeline/vendor/github.com/knative/pkg/webhook/webhook.go:310
  main.main
      /usr/local/google/home/jasonhall/go/src/github.com/knative/build-pipeline/cmd/webhook/main.go:97"
}

This patch fixes it by adding the missing rules for
deployments/finailizer resource to the cluster-role.

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

Release Notes

Updates `tekton-pipelines-admin` clusterrole to have full access to `deployments/finalizers`

Installing tekton on minishift fails to bring up webhook-controller pod
due missing RBAC policy. Pod logs shows the following error
``` json
{
  "level":"error",
  "logger":"webhook",
  "caller":"webhook/webhook.go:310" ,
  "msg":"failed to register webhook"
  "knative.dev/controller":"webhook"
  "error":"failed to create a webhook: mutatingwebhookconfigurations.admissionregistration.k8s.io
      \"webhook.tekton.dev\" is forbidden:
      cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: no RBAC policy matched
 "
"stacktrace":"
  github.com/knative/build-pipeline/vendor/github.com/knative/pkg/webhook.(*AdmissionController).Run
      /usr/local/google/home/jasonhall/go/src/github.com/knative/build-pipeline/vendor/github.com/knative/pkg/webhook/webhook.go:310
  main.main
      /usr/local/google/home/jasonhall/go/src/github.com/knative/build-pipeline/cmd/webhook/main.go:97"
}
```

This patch fixes it by adding the missing rules for
`deployments/finailizer` resource to the cluster-role.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 1, 2019
@sthaha
Copy link
Member Author

sthaha commented Mar 1, 2019

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit and removed cla: no labels Mar 1, 2019
@sthaha
Copy link
Member Author

sthaha commented Mar 1, 2019

/assign vdemeester

@vdemeester
Copy link
Member

/ok-to-test

@knative-prow-robot knative-prow-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 1, 2019
Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2019
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shashwathi, sthaha

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

The pull request process is described here

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2019
@knative-prow-robot knative-prow-robot merged commit 1d8ddd2 into tektoncd:master Mar 1, 2019
@sthaha sthaha deleted the fix-webhook-crashloop branch March 4, 2019 01:17
@bobcatfish
Copy link
Collaborator

(note @sthaha I updated your release note!)

@sthaha
Copy link
Member Author

sthaha commented Mar 14, 2019

(note @sthaha I updated your release note!)

Thank you! If you could point me at the commit, I will have release notes updated as well next time I submit a patch.

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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants