-
Notifications
You must be signed in to change notification settings - Fork 8
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
compass-id-for-migration
#32
compass-id-for-migration
#32
Conversation
71c88be
to
e638bb6
Compare
// KubeconfigKey is the name of the key in the secret storing cluster credentials. | ||
// The secret is created by KEB: https://github.com/kyma-project/control-plane/blob/main/components/kyma-environment-broker/internal/process/steps/lifecycle_manager_kubeconfig.go | ||
KubeconfigKey = "config" | ||
) | ||
|
||
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch | ||
//+kubebuilder:rbac:groups=operator.kyma-project.io,resources=kymas,verbs=get;list;watch | ||
//+kubebuilder:rbac:groups=operator.kyma-project.io,resources=compassmanagermappings,verbs=create;get;list;delete | ||
//+kubebuilder:rbac:groups=operator.kyma-project.io,resources=compassmanagermappings,verbs=create;get;list;delete;watch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compass Manager also needs the update
method in RBAC to perform Upsert
could you add it?
@@ -27,6 +27,27 @@ var _ = Describe("Compass Manager controller", func() { | |||
kymaCustomResourceLabels := make(map[string]string) | |||
kymaCustomResourceLabels["operator.kyma-project.io/managed-by"] = "lifecycle-manager" | |||
|
|||
It("handles `compass-runtime-id-for-migration`", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating a test case we follow this pattern: Describe -> Context -> It / DescribeTable. Could you adjust this test case to the pattern? You can check how the other tests are described.
Could you also perform |
kymaAnnotations, err := cm.getKymaAnnotations(req.NamespacedName) | ||
if err != nil { | ||
cm.Log.Warnf("Failed to obtain annotations from Kyma resource %s: %v.", req.Name, err) | ||
return ctrl.Result{RequeueAfter: cm.requeueTime}, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequeueAfter
doesn't work if error was returned from Reconcile
. Consider this flow
- if the error is from the k8s
client-go
method e.g.Get
,List
,Update
the controller should set itself to Error state - if the error results from any other component such as a problem with connection to Compass Director etc, the request should be requeueed in
RequeueAfter
withnil
error. Before return we should log.Warn with message.
to satisfy trivy
Description
Changes proposed in this pull request:
Related issue(s)