Skip to content

Invalid manifest creation due to lack of guards around labels  #918

Open
@nabadger

Description

@nabadger

Describe the bug
Using default values the helm template generates invalid manifests.

To Reproduce

helm template myapp . 

You will end up with something like:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: myapp-operator-manager-role
  labels:
  namespace: default
...

This happens on multiple resources.

I think the bulk of the issues come from the operator, for example: https://github.com/kubeshop/helm-charts/blob/main/charts/testkube-operator/templates/rolebinding.yaml#L8

It's also not clear where globalLabels comes from (not sure it's specified as an option in values.yaml)

Expected behavior
If there are no label values defined the labels field should not be present.

Version / Cluster

  • Which testkube version? Chart version 2.0.17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions