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

enhance error logging for existing object is not controlled by UID - add GVK, Resource Name etc. #5488

Closed
Tracked by #3957
haarchri opened this issue Mar 15, 2024 · 3 comments · Fixed by #5698
Closed
Tracked by #3957
Labels
composition enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@haarchri
Copy link
Contributor

What problem are you facing?

please provide an indication which resource is not controlled by the correct object. If my compostion has 30 resources, it would be good to have an indicator, which resource is not controlled by the correct UID.

cannot compose resources: cannot apply composed resource: existing object is not controlled by UID "941a35fb-16b2-49af-be92-55e34e08cfbe"

image

How could Crossplane help solve your problem?

@haarchri haarchri added the enhancement New feature or request label Mar 15, 2024
@santhoshivan23
Copy link
Contributor

santhoshivan23 commented Mar 17, 2024

looks like a quick fix? @negz - can you tell me where this is logged? i did a global search for this log but couldn't find it

@santhoshivan23
Copy link
Contributor

@negz I figured out that the change has to be done in crossplane-runtime. This function has to accept some more params and log it.

func MustBeControllableBy(u types.UID) ApplyOption {
	return func(_ context.Context, current, _ runtime.Object) error {
		c := metav1.GetControllerOf(current.(metav1.Object))
		if c == nil {
			return nil
		}

		if c.UID != u {
			return errNotControllable{errors.Errorf("existing object is not controlled by UID %q", u)}

		}
		return nil
	}
}

@birapjr
Copy link

birapjr commented Apr 16, 2024

This issue also affect us. Would be nice to have this information. We are recreating a complete EKS cluster and some resources were not deleted and the same error happen and no information on what resource the problem is.

@jbw976 jbw976 added the good first issue Good for newcomers label Apr 26, 2024
@jbw976 jbw976 added this to the v1.17 milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composition enhancement New feature or request good first issue Good for newcomers
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants