kompose: Image name not given still kompose does not errors out

Using docker-compose file that has no field for image, so this should error out, but this still works.

$ cat /tmp/docker-compose-no-image.yml 
version: "2"

services:
  mariadb:
    ports:
      - 3306

output

$ kompose convert --stdout -y -f /tmp/docker-compose-no-image.yml                                                                                                                       
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    service: mariadb
  name: mariadb
spec:
  ports:
  - name: "3306"
    port: 3306
    protocol: TCP
    targetPort: 3306
  selector:
    service: mariadb
status:
  loadBalancer: {}

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    service: mariadb
  name: mariadb
spec:
  replicas: 1
  selector:
    matchLabels:
      service: mariadb
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        service: mariadb
    spec:
      containers:
      - name: mariadb
        ports:
        - containerPort: 3306
          protocol: TCP
        resources: {}
      restartPolicy: Always
status: {}

---

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

@ngtuna sure, go ahead