Skip to content

Conversation

@machacekondra
Copy link
Member

@machacekondra machacekondra commented Mar 22, 2019

This is backport of: #272

Previously when creating a resource list, kind was a dictionary meaning
that there could be only one resource for specific kind. But for example
Template kind can have two different resources:

$ oc api-resources | grep Template$
processedtemplates template.openshift.io true Template
templates.         template.openshift.io true Template

So The client previsously found just one resource for kind Template.
In order to work with both resources for that kind this patch introduces
the change that kind will be list by default.

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 22, 2019
@openshift-ci-robot
Copy link

Hi @machacekondra. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@machacekondra
Copy link
Member Author

Hi @fabianvf, do you think we can get this into 0.8.x release?

@fabianvf
Copy link
Member

Yes I'm sorry, I've just been slammed. I just need to verify that this doesn't break Ansible and then I'll merge and release. Apologies for the delay

@machacekondra
Copy link
Member Author

I am aware of "changing" just one thing:

https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/k8s/common.py#L182

Before if user used following code:

self.find_resource('Template', 'template.openshift.io/v1')

It will now fail, because there are more resources for that kind. Previously it just returned template resource, or proccessedtemplate resrouce, not sure which one.

@fabianvf fabianvf merged commit 46cf660 into openshift:release-0.8 Mar 26, 2019
@fabianvf
Copy link
Member

It will now fail, because there are more resources for that kind. Previously it just returned template resource, or proccessedtemplate resrouce, not sure which one.

Yeah, it will currently fail, although I think that is more correct, as it was undefined whether it would return and operate on processedtemplate or template resources. The core issue there is that the Template resource violates API convention (GVK -> unique resource), and AFAIK they never worked properly from the k8s module anyway. If I'm wrong about that and there are examples of the Template APIs working properly I will prioritize fixing this behavior, but I think we need additional work to get templates working from Ansible with or without this change in behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants