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

CronJobs are required to have annotations defined #53

Open
vinny-sabatini opened this issue Apr 16, 2020 · 1 comment
Open

CronJobs are required to have annotations defined #53

vinny-sabatini opened this issue Apr 16, 2020 · 1 comment

Comments

@vinny-sabatini
Copy link

The openshift-provision role fails if you try to manage a CronJob that does not have any annotations.

This was tested against an OpenShift 3.11 cluster, and the CronJob we were trying to manage was defined as a Jinja template.

Here is the error log into this issue:
Traceback (most recent call last):
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 1536, in run_module
        provisioner.provision()
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 1401, in provision
        patch = self.compare_resource(current_resource)
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 1275, in compare_resource
        config = self.normalize_resource(compare_to)
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 1145, in normalize_resource
        normalize_resource_method(resource)
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 1196, in normalize_resource_CronJob
        normalize_CronJob_V1beta1(resource)
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 501, in normalize_CronJob_V1beta1
        normalize_CronJobSpec_V1beta1(cron_job['spec'])
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 507, in normalize_CronJobSpec_V1beta1
        normalize_JobTemplateSpec_V1beta1(spec['jobTemplate'])
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 661, in normalize_JobTemplateSpec_V1beta1
        normalize_ObjectMeta_V1(spec['metadata'])
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 733, in normalize_ObjectMeta_V1
        'annotations': {}
    File "/tmp/ansible_phgzaB/ansible_module_openshift_provision.py", line 234, in set_dict_defaults
        if k not in d:
    TypeError: argument of type 'NoneType' is not iterable
@realnedsanders
Copy link

realnedsanders commented Apr 29, 2020

This should be fixed with PR #54.
I carefully considered the implications of making changes to the set_dict_defaults function.
After reading the 69 or so references, I think this is an acceptable change to make.

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

No branches or pull requests

2 participants