Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

[BUG]Two examples of oam: flight-tracker and dependency do not authorize oam's permissions to crd, so the example will not run. #270

Closed
linjiemiao opened this issue Oct 26, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@linjiemiao
Copy link
Contributor

When I deploy flight-tracker, oam does not have permission to ingress, so it will report an error:

	oam-kubernetes-runtime	Cannot apply components	{"controller": "oam/applicationconfiguration.core.oam.dev", "request": "default/service-tracker", "uid": "30f8793c-5359-4e46-ab4b-f0b034838c5e", "version": "149846771", "error": "cannot apply trait \"extensions/v1beta1\" \"Ingress\" \"tracker-ingress\": cannot get object: ingresses.extensions \"tracker-ingress\" is forbidden: User \"system:serviceaccount:oam-system:oam-kubernetes-runtime-core-runtime\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"default\"", "errorVerbose": "ingresses.extensions \"tracker-ingress\" is forbidden: User \"system:serviceaccount:oam-system:oam-kubernetes-runtime-core-runtime\" cannot get resource \"ingresses\" in API group \"extensions\" in the namespace \"default\"\ncannot get object\ngithub.com/crossplane/crossplane-runtime/pkg/resource.(*APIPatchingApplicator).Apply\n\t/go/pkg/mod/github.com/crossplane/[email protected]/pkg/resource/api.go:145\ngithub.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2/applicationconfiguration.(*workloads).Apply\n\t/workspace/pkg/controller/v1alpha2/applicationconfiguration/apply.go:96\ngithub.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2/applicationconfiguration.(*OAMApplicationReconciler).Reconcile\n\t/workspace/pkg/controller/v1alpha2/applicationconfiguration/applicationconfiguration.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/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/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:90\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357\ncannot apply trait \"extensions/v1beta1\" \"Ingress\" \"tracker-ingress\"\ngithub.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2/applicationconfiguration.(*workloads).Apply\n\t/workspace/pkg/controller/v1alpha2/applicationconfiguration/apply.go:97\ngithub.com/crossplane/oam-kubernetes-runtime/pkg/controller/v1alpha2/applicationconfiguration.(*OAMApplicationReconciler).Reconcile\n\t/workspace/pkg/controller/v1alpha2/applicationconfiguration/applicationconfiguration.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/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/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:90\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357", "requeue-after": "2020-10-23T03:16:14.764Z"}

So we need to add a ClusterRole with label rbac.oam.dev/aggregate-to-controller: "true" to the example。
A similar problem exists in the dependency example

@wonderflow wonderflow added the bug Something isn't working label Oct 27, 2020
@wonderflow
Copy link
Member

Thanks for your report, this bug was exactly what you descirbed, would you like to send a PR? @linjiemiao

@linjiemiao
Copy link
Contributor Author

Thanks for your report, this bug was exactly what you descirbed, would you like to send a PR? @linjiemiao

ok, i will send a pr

linjiemiao added a commit to silotrd/oam-kubernetes-runtime that referenced this issue Oct 27, 2020
…ssion to

add, delete, modify and check the CRD, the oam example cannot be run
correcttly.
linjiemiao added a commit to silotrd/oam-kubernetes-runtime that referenced this issue Oct 27, 2020
…ssion to

add, delete, modify and check the CRD, the oam example cannot be run
correcttly.

Signed-off-by: linjie.miao <[email protected]>
linjiemiao added a commit to silotrd/oam-kubernetes-runtime that referenced this issue Oct 27, 2020
…ssion to

add, delete, modify and check the CRD, the oam example cannot be run
correcttly.

Signed-off-by: linjie.miao <[email protected]>
wonderflow added a commit that referenced this issue Oct 27, 2020
[ISSUE #270] Bug fixed, OAM example can not run correctlly.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants