Skip to content

[linkwarden] templating issue with kubernetes/helm strategy enabled #37

@titey

Description

@titey

Name and Version

fmjstudios/linkwarden 0.3.3

What architecture are you using?

amd64

What steps will reproduce the bug?

With strategy enabled like this:

## @param strategy Specify a deployment strategy for the Linkwarden pod
##
strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1

.. Helm will template-it like this:

---
# Source: linkwarden/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: linkwarden
  namespace: linkwarden
  labels:
    helm.sh/chart: linkwarden-0.3.3
    app.kubernetes.io/name: linkwarden
    app.kubernetes.io/instance: linkwarden
    app.kubernetes.io/version: "2.5.3"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: linkwarden
      app.kubernetes.io/instance: linkwardenstrategy:  # <== !!!
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate

The selector app.kubernetes.io/instance line is merged with strategy:.

I think this is related to the line stripping -}} in https://github.com/fmjstudios/helm/blob/main/charts/linkwarden/templates/deployment.yaml#L13

Are you using any custom parameters or values?

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1

What is the expected behavior?

spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: linkwarden
      app.kubernetes.io/instance: linkwarden
  strategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate

What do you see instead?

spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: linkwarden
      app.kubernetes.io/instance: linkwardenstrategy:  # <== !!!
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions