The pipe configuration below fails:
INFO: Successfully updated the kube config.
Traceback (most recent call last):
File "/pipe.py", line 47, in <module>
pipe.run()
File "/root/.local/lib/python3.8/site-packages/kubectl_run/pipe.py", line 157, in run
self.handle_apply()
File "/root/.local/lib/python3.8/site-packages/kubectl_run/pipe.py", line 114, in handle_apply
self.update_labels_in_metadata(template_file, labels)
File "/root/.local/lib/python3.8/site-packages/kubectl_run/pipe.py", line 37, in update_labels_in_metadata
yaml_doc['metadata'].setdefault('labels', {}).update(labels)
TypeError: 'NoneType' object is not iterable
@Brad Vrabete Hi. Thanks for your question. This error can occur only if `LABELS` is empty. We will try investigate this case and give you feedback soon.
Regards, Igor.
Thanks, Igor. I tried to disable the labels as the branch name was longer than 63 characters accepted by Kubectl for a label.
Now, if you can see the script, LABELS is definitely not empty:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Brad Vrabete Seems like you doing it right and the problem on our side.
The only one temporary solution i can provide is to pass labels directly to your template file "k8s/deploy/aws-dev" under `kind: Deployment metadata`.
Example of the template:
template = """
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
<pass your custom labels here>
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx:1.7.9
name: nginx
ports:
- containerPort: 80
"""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually found an easier way:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to know you found a solution for your case. Anyway, thanks for your feedback about problem with LABELS you have found.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Brad Vrabete . The issue with LABELS fixed in aws-eks-kubectl-run:2.3.0 pipe .
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.