Closed koraykoska closed 5 years ago
It looks like we will have to add dynamic names like kube.volkn.cloud/cloud-build-cd-name_<name>
and search for their existence. This allows adding multiple labels to one deployment and searching for them separately. Also their value could contain the position of the container in the templates array so we don't have to search it.
https://github.com/kubernetes/apimachinery/issues/47 https://github.com/kubernetes/apimachinery/blob/master/pkg/labels/selector.go#L807
Solved with the latest commit. Label keys are now dynamic like in the example kube.volkn.cloud/cloud-build-cd-name_ <name>
and values are required to be in the format <branchName>.<containerPosition>
, which solves this issue as well as #3
Currently we can only update one container per deployment. Also this has to be the first one in the list. It would be nice to have the possibility to update sidecar containers. Maybe by extending the tag to a comma separated list if querying labels supports searching for substrings...?