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

compass-id-for-migration #32

Merged

Conversation

VOID404
Copy link
Contributor

@VOID404 VOID404 commented Oct 10, 2023

Description

Changes proposed in this pull request:

  • ...
  • ...
  • ...

Related issue(s)

@VOID404 VOID404 requested a review from a team as a code owner October 10, 2023 11:54
@CLAassistant
Copy link

CLAassistant commented Oct 10, 2023

CLA assistant check
All committers have signed the CLA.

@kyma-bot kyma-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 10, 2023
// 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
Copy link
Contributor

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() {
Copy link
Contributor

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.

@mvshao
Copy link
Contributor

mvshao commented Oct 13, 2023

Could you also perform make generate command to generate new API files? It needs to be done every time we make changes in api directory.

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
Copy link
Contributor

@mvshao mvshao Oct 13, 2023

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 with nil error. Before return we should log.Warn with message.

mvshao
mvshao previously approved these changes Oct 18, 2023
@kyma-bot kyma-bot added the lgtm Looks good to me! label Oct 18, 2023
to satisfy trivy
@kyma-bot kyma-bot removed the lgtm Looks good to me! label Oct 18, 2023
@kyma-bot kyma-bot added the lgtm Looks good to me! label Oct 18, 2023
@kyma-bot kyma-bot merged commit a3c3c98 into kyma-project:main Oct 18, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Looks good to me! 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