Skip to content

Use Controller name as finalizer #218

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

Closed
wants to merge 3 commits into from

Conversation

escher-m
Copy link

In reference to Issue #57

if(getAnnotation(controller).finalizerName().equals(DEFAULT_FINALIZER))
{
//[package+"."+classNameOfController]
return getAnnotation(controller).customResourceClass.getPackage().getName() + "." + getAnnotation(controller).customResourceClass.getSimpleName();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more like the name of the customResource. Original idea was to use controller.getClass()

@escher-m
Copy link
Author

@csviri I couldn't find any package instantiation by searching in the repository.
So I used code from ControllerUtils.java :

    getCustomResourceDoneableClass(ResourceController<T> controller) {
        try {
            Class<? extends CustomResource> customResourceClass = getAnnotation(controller).customResourceClass();
            String className = **customResourceClass.getPackage().getName()** + "." + customResourceClass.getSimpleName() + "CustomResourceDoneable";

            if (doneableClassCache.containsKey(customResourceClass)) {
                return (Class<? extends CustomResourceDoneable<T>>) doneableClassCache.get(customResourceClass);
            }

@csviri
Copy link
Collaborator

csviri commented Nov 2, 2020

@escher-m you receive the controller as the parameter for this exact method, I ment the name of the class of that controller instance should be used.

Also I can see that checks are failing on this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants