Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

kubectl pipe error: KeyError: 'metadata'

I'm trying to use the kubectl pipe to deploy to kubernets but I'm getting the error:

Traceback (most recent call last):  File "/pipe.py", line 165, in <module>    pipe.run()  File "/pipe.py", line 156, in run    self.handle_apply()  File "/pipe.py", line 113, in handle_apply    self.update_labels_in_metadata(template_file, labels)  File "/pipe.py", line 36, in update_labels_in_metadata    yaml_doc['metadata'].setdefault('labels', {}).update(labels)KeyError: 'metadata'

I assume that this is because my yml doesn't have a root element "metadata". The yml was generated using the fabric8 maven plugin, and looks similar to the below (I've removed large chunks of it, but this should be enough to go on:

---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
annotations:
labels:
name:
spec:
ports:
type: NodePort
- apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
labels:
name:
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
template:
metadata:
annotations:
labels:
spec:
containers:

 

 

 

1 answer

0 votes

Hi @Martin Cassidy

Thank you for your question!

We'll investigate this issue and notify you.

 

Cheers,
Oleksandr Kyrdan

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,652 views 63 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you