Reconcile openshift_resources fail on actual apply, passes dry run
aditya-konarde opened this issue · 2 comments
aditya-konarde commented
Dry run for annotating a configmap:
(venv) [akonarde@katana qontract-reconcile]$ qontract-reconcile --config=config.toml --dry-run openshift-resources-annotate app-sre app-sre-exporters ConfigMap cloudwatch-exporter-config
INFO: annotated
For the same resource, running the actual annotation
(venv) [akonarde@katana qontract-reconcile]$ qontract-reconcile --config=config.toml openshift-resources-annotate app-sre app-sre-exporters ConfigMap cloudwatch-exporter-config
Traceback (most recent call last):
File "/home/akonarde/Git/qontract-reconcile/venv/bin/qontract-reconcile", line 11, in <module>
load_entry_point('reconcile==0.1.0', 'console_scripts', 'qontract-reconcile')()
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/Click-7.0-py3.7.egg/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/reconcile-0.1.0-py3.7.egg/reconcile/cli.py", line 99, in openshift_resources_annotate
ctx.obj['dry_run'], cluster, namespace, kind, name)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/reconcile-0.1.0-py3.7.egg/reconcile/cli.py", line 20, in run_integration
func(*args)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/reconcile-0.1.0-py3.7.egg/reconcile/openshift_resources_annotate.py", line 64, in run
oc.apply(namespace, openshift_resource.toJSON())
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/reconcile-0.1.0-py3.7.egg/utils/oc.py", line 55, in apply
self._run(cmd, stdin=resource)
File "/home/akonarde/Git/qontract-reconcile/venv/lib/python3.7/site-packages/reconcile-0.1.0-py3.7.egg/utils/oc.py", line 76, in _run
out, err = p.communicate(stdin_text)
File "/usr/lib64/python3.7/subprocess.py", line 939, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib64/python3.7/subprocess.py", line 1666, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
aditya-konarde commented
This is a problem with the version of python being used.
The code works with python2, but not with python3