Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencompose generates deployment per container #86

Closed
surajssd opened this issue Apr 1, 2017 · 0 comments · Fixed by #87
Closed

opencompose generates deployment per container #86

surajssd opened this issue Apr 1, 2017 · 0 comments · Fixed by #87

Comments

@surajssd
Copy link
Contributor

surajssd commented Apr 1, 2017

I am using this opencompose file:

version: 0.1-dev
services:
- name: helloworld
  containers:
  - image: tomaskral/nonroot-nginx
    ports:
    - port: 8080
  - image: hell
    ports:
    - port: 1111

When run i get error as follows:

✔ ~/go/src/github.com/redhat-developer/opencompose/examples [master ↑·52|✚ 1] 
11:59 $ opencompose convert -f hello-nginx.yaml -o -
---
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    service: helloworld
  name: helloworld
spec:
  ports:
  - name: port-8080
    port: 8080
    targetPort: 8080
  - name: port-1111
    port: 1111
    targetPort: 1111
  selector:
    service: helloworld
  type: ClusterIP
status:
  loadBalancer: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    service: helloworld
  name: helloworld
spec:
  strategy:
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        service: helloworld
    spec:
      containers:
      - image: tomaskral/nonroot-nginx
        name: helloworld-0
        ports:
        - containerPort: 8080
          name: port-8080
        resources: {}
      - image: hell
        name: helloworld-1
        ports:
        - containerPort: 1111
          name: port-1111
        resources: {}
status: {}
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    service: helloworld
  name: helloworld
spec:
  strategy:
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        service: helloworld
    spec:
      containers:
      - image: tomaskral/nonroot-nginx
        name: helloworld-0
        ports:
        - containerPort: 8080
          name: port-8080
        resources: {}
      - image: hell
        name: helloworld-1
        ports:
        - containerPort: 1111
          name: port-1111
        resources: {}
status: {}

I think this was not discovered because we were only generating files and the file might have been over written.

surajssd added a commit to surajssd/opencompose that referenced this issue Apr 1, 2017
Deployment was generated per container. This commit fixes
that behavior and generates only one deployment.

This was not noticed before because in convert only files
were generated so the extra file was over written.

Now with the new feature of showing output to STDOUT this
issue was discovered.

Fixes redhat-developer#86
@kadel kadel closed this as completed in #87 Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant