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

Wrong output when port is missing #121

Closed
ngtuna opened this issue Aug 23, 2016 · 0 comments
Closed

Wrong output when port is missing #121

ngtuna opened this issue Aug 23, 2016 · 0 comments
Assignees

Comments

@ngtuna
Copy link
Contributor

ngtuna commented Aug 23, 2016

The current convert function is not working correctly. When port is missing, objects are converted in init state.

$ cat docker-compose.yml.tuna 
web:
  image: tuna/docker-counter23
  environment:
    - version=1.0
  links:
    - redis
redis:
  image: redis:3.0
  ports:
    - "6379"

$ kompose convert --file docker-compose.yml.tuna
WARN[0000] [web] Service cannot be created because of missing port. 
INFO[0000] file "web-deployment.json" created           
INFO[0000] file "redis-deployment.json" created         
INFO[0000] file "redis-service.json" created   

$ cat web-deployment.json 
{
  "kind": "Deployment",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "web",
    "creationTimestamp": null
  },
  "spec": {
    "replicas": 1,
    "template": {
      "metadata": {
        "creationTimestamp": null
      },
      "spec": {
        "volumes": null,
        "containers": [
          {
            "name": "web",
            "image": "tuna/docker-counter23",
            "resources": {},
            "imagePullPolicy": ""
          }
        ],
        "serviceAccountName": ""
      }
    },
    "strategy": {}
  },
  "status": {}
}

environment is missing in the deployment web.

The problem came from this line:
https://github.com/skippbox/kompose/blob/master/pkg/transformer/kubernetes/kubernetes.go#L243

If ports not provided in configuration we will not make service, but we will also not update objects.

@ngtuna ngtuna added the bug label Aug 23, 2016
@ngtuna ngtuna self-assigned this Aug 23, 2016
@ngtuna ngtuna closed this as completed in 4f36dca Aug 24, 2016
ngtuna added a commit that referenced this issue Aug 24, 2016
fix #121: update all objects, even when port is missing
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

No branches or pull requests

1 participant