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
[k8s] Failed to find exact match for v1.DeploymentConfig by [kind, name, singularName, shortNames] #55221
Comments
Files identified in the description: If these files are inaccurate, please update the |
Can you add a task before that one with
I get a different response from openshift 3.6 (using openshift/origin:v3.6.1 container) so would be good to be able to reproduce your exact issue |
Ah, reproduced it by upgrading my openshift to 0.8.7 |
So, I've got to the bottom of this but I don't know what to do about it. Basically in the /oapi/v1 response, both generatedeploymentconfig and deploymentconfig resources are of kind DeploymentConfig. When looking for what resource to use for kind DeploymentConfig, multiple resources are returned so a generatedeploymentconfig is deprecated in openshift 3.7, 3.6 is an incredibly old openshift version, so I'm not sure what to do from here - @fabianvf might be able to help in the openshift/openshift-restclient-python repository |
I can confirm this issue goes away running against openshift/origin:v3.7 It may still be worth addressing in case of future API changes, although I'd hope that the mappings are more consistent these days. |
Thanks for confirming the issue and that it works with 3.7. I need to deploy in production on 3.6, before the upgrade to 3.7. |
Also, since I'm finding nothing about this generatedeploymentconfig, I suppose nobody is using it and would it be possible to filter it out from the Ansible module? |
This problem should really be addressed upstream in the openshift library - we don't have enough control to filter this out. If you're seeing ResourceNotFoundError then you may need a newer version of the openshift library. |
Ok this is solved. After digging into the openshift lib code, I found that search() was returning 3 objects: I managed to fix my issue by using apiVersion: apps.openshift.io/v1 instead of v1 Thanks for the help |
@amadeus-chuot thanks a ton for your additional investigation! I'll create a follow-up issue to surface these errors a little better, you shouldn't have to dig around manually to find that information. |
For anyone interested, here's a non-ideal work-around for my similar issue:
It should work for the - name: Create resources from OpenShift template
shell: |
oc create -n {{ openshift_project_name }} -f - <<-'EOF'
{{ lookup('template', role_path + '/templates/main.yaml.j2') }}
EOF |
SUMMARY
I'm not able to use k8s to create a DeploymentConfig on Openshift 3.6.
Error messages are:
Please help to fix or advise if it is not supported.
The same setup works when creating Pods or Secrets.
ISSUE TYPE
COMPONENT NAME
k8s
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
MacOS 10.13.6
$ uname -a
Darwin NCELRND0546 17.7.0 Darwin Kernel Version 17.7.0: Thu Dec 20 21:47:19 PST 2018; root:xnu-4570.71.22~1/RELEASE_X86_64 x86_64 i386 MacBookPro14,1 Darwin
Gentoo Prefix
Virtualenv for ansible
STEPS TO REPRODUCE
Here is a small test config:
playbook.yml
test.yml:
and a minimalist inventory which is actually not used (since running on control node):
inventory:
EXPECTED RESULTS
The DeploymentConfig should be created
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: