Skip to content

[BUG] with-kompose-annotation=false not working in 1.30.0 #1713

@mbuchner

Description

@mbuchner

Expected Behavior

When using flag "--with-kompose-annotation=false" that the annotations are gone

Actual Behavior

Annotations are still there ...

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.service.healthcheck.liveness.tcp_port: "80"
    kompose.service.healthcheck.readiness.http_get_path: /health
    kompose.service.healthcheck.readiness.http_get_port: "80"
    kompose.service.healthcheck.readiness.interval: 60s
    kompose.service.healthcheck.readiness.retries: "3"
    kompose.service.healthcheck.readiness.start_period: 10s
    kompose.service.healthcheck.readiness.timeout: 3s
  creationTimestamp: null
  labels:
    io.kompose.service: nginx-ui
  name: nginx-ui
  namespace: default
spec:
  ports:
    - name: "8881"
      port: 8881
      targetPort: 80
  selector:
    io.kompose.service: nginx-ui
status:
  loadBalancer: {}

---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.service.healthcheck.liveness.tcp_port: "80"
    kompose.service.healthcheck.readiness.http_get_path: /health
    kompose.service.healthcheck.readiness.http_get_port: "80"
    kompose.service.healthcheck.readiness.interval: 60s
    kompose.service.healthcheck.readiness.retries: "3"
    kompose.service.healthcheck.readiness.start_period: 10s
    kompose.service.healthcheck.readiness.timeout: 3s
  creationTimestamp: null
  labels:
    io.kompose.service: nginx-ui
  name: nginx-ui
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: nginx-ui
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kompose.service.healthcheck.liveness.tcp_port: "80"
        kompose.service.healthcheck.readiness.http_get_path: /health
        kompose.service.healthcheck.readiness.http_get_port: "80"
        kompose.service.healthcheck.readiness.interval: 60s
        kompose.service.healthcheck.readiness.retries: "3"
        kompose.service.healthcheck.readiness.start_period: 10s
        kompose.service.healthcheck.readiness.timeout: 3s
      creationTimestamp: null
      labels:
        io.kompose.network/simple-default: "true"
        io.kompose.service: nginx-ui
    spec:
      containers:
        - env:
            - name: BACKEND_URL
              value: http://some-backend:8080
          image: nginx:latest
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 10
            periodSeconds: 60
            tcpSocket:
              port: 80
            timeoutSeconds: 3
          name: nginx-ui
          ports:
            - containerPort: 80
              hostPort: 8881
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 10
            periodSeconds: 60
            timeoutSeconds: 3
          resources: {}
          volumeMounts:
            - mountPath: /var/xxx
              name: xxx-volume
      restartPolicy: Always
      volumes:
        - name: xxx-volume
          persistentVolumeClaim:
            claimName: xxx-volume
status: {}

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: xxx-volume
  name: xxx-volume
  namespace: default
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
status: {}

Steps To Reproduce

install in windows via: winget kompose (as admin - otherwise its not working / renaming correctly)

kompose convert --with-kompose-annotation=false --stdout

Kompose Version

kompose version
1.30.0 (9d8dcb518)

Docker-Compose file

version: '2'
services:
  nginx-ui:
    image: nginx:latest
    environment:
      BACKEND_URL: http://some-backend:8080
    ports:
    - 8881:80/tcp
    healthcheck:
      interval: 60s
      timeout: 3s
      retries: 3
      start_period: 10s
    volumes:
    - xxx-volume:/var/xxx
    labels:
      kompose.service.healthcheck.liveness.tcp_port: 80
      kompose.service.healthcheck.readiness.http_get_path: /health
      kompose.service.healthcheck.readiness.http_get_port: 80
      kompose.service.healthcheck.readiness.interval: 60s
      kompose.service.healthcheck.readiness.timeout: 3s
      kompose.service.healthcheck.readiness.retries: 3
      kompose.service.healthcheck.readiness.start_period: 10s

volumes:
  xxx-volume:

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions