-
Notifications
You must be signed in to change notification settings - Fork 219
feat: dependent resource context + my sql e2e test improvements #979
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
Conversation
Added access to managed dependent resources, not sure if that is there the map in the context makes sense anymore. @metacosm |
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java
Outdated
Show resolved
Hide resolved
context.getMandatory(MYSQL_SECRET_USERNAME, String.class)); | ||
Secret secret = context.getSecondaryResource(Secret.class).orElseThrow(); | ||
SchemaDependentResource schemaDependentResource = context.managedDependentResourceContext() | ||
.getDependentResource(SchemaDependentResource.class); |
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.
I think it'd be better to get the dependent via its class in a way similar to what we do for secondary resources, i.e. getDependentResource(Schema.class)
, though I guess this way this side-steps the issue of what to do when there are multiple dependents with the same type? Maybe provide both versions?
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.
I think it'd be better to get the dependent via its class in a way similar to what we do for secondary resources, i.e. getDependentResource(Schema.class)
That is how it's done, just hidden behind dedicated context. Or?
though I guess this way this side-steps the issue of what to do when there are multiple dependents with the same type? Maybe provide both versions?
I intentionally did not cover this, since on denepnds_on we plan to have names of the resources, so I would add that as part of it?!
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.
Minor nit-pick, otherwise LGTM.
Kudos, SonarCloud Quality Gate passed! |
No description provided.