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

Permissions for OwnerReferencesPermissionEnforcement plugin #86

Open
OleksandrShtepa opened this issue Jun 5, 2023 · 0 comments
Open
Labels

Comments

@OleksandrShtepa
Copy link

Describe the bug
In OKD OwnerReferencesPermissionEnforcement plugin enabled by default.
I got follow error after attempt to create Secret by StringSecret CRD:

{"level":"info","ts":1685956649.2009747,"logger":"controller_string_secret","msg":"Reconciling StringSecret","Request.Namespace":"test","Request.Name":"test"}
{"level":"error","ts":1685956649.2061837,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"stringsecret-controller","request":"test/test","error":"secrets \"test\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil>","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/runner/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:88"}

This is error like this in Operator SDK

Environment:

  • Kubernetes version: v1.24.0-2568+56584349e9412b-dirty
  • OKD: 4.11.0
  • kubernetes-secret-generator version: 3.4.0

Additional context
I have fixed this error for me by patch:

+   - apiGroups:
+         - secretgenerator.mittwald.de
+     resources:
+       - basicauths/finalizers
+       - sshkeypairs/finalizers
+       - stringsecrets/finalizers
+     verbs:
+       - update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant