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

Save the cmd used to create config #639

Closed
surajssd opened this issue Jun 14, 2017 · 9 comments
Closed

Save the cmd used to create config #639

surajssd opened this issue Jun 14, 2017 · 9 comments
Assignees
Milestone

Comments

@surajssd
Copy link
Member

When we generate config it is really hard to know what command was used to generate that config. And has caused issues in past. As much as important it is to have the docker-compose file to generate the artifacts the command line flags used to generate config are also important, so we should have some way to know what flags were used to generate specific config.

So I propose saving the command given to convert along with flags in annotations of generated configs

like if I use:

kompose convert --emptyvols

This should show up in the converted annotations like

...
annotations:
  "kompose.cmd": "kompose convert --emptyvols"
  "kompose.version": "0.6.0 (45a0daw)"
...

This will help us mitigate issues like #632

@kadel
Copy link
Member

kadel commented Jun 14, 2017

This is a good idea.
But maybe instead of full command, it might be better to add something that can be easily parsed.
Or add another extra annotation that will be easy to parse.

...
annotations:
  "kompose.cmd": "kompose convert --emptyvols"
  "kompose.version": "0.6.0 (45a0daw)"
  "kompose.data": "{version: 0.6.0, command: 'convert', emptyvols: 'true'} "
....

@surajssd
Copy link
Member Author

@kadel yeah even that SGTM!

@cdrage
Copy link
Member

cdrage commented Jun 14, 2017

This sounds great! Would really help in term's of troubleshooting conversions.

@surajnarwade
Copy link
Contributor

I am taking this up.

@surajnarwade surajnarwade self-assigned this Jul 19, 2017
@cdrage cdrage added this to the 1.1.0 release milestone Jul 19, 2017
@surajnarwade
Copy link
Contributor

Since this will be major change in all unit test case and functional test files,
I have something output as of now,

metadata:
    annotations:
      kompose.cmd: kompose convert --stdout
      kompose.version: |
        1.0.0 (HEAD)

Any suggestions before sending PR? @surajssd @kadel @cdrage

@surajnarwade
Copy link
Contributor

surajnarwade commented Jul 24, 2017

This will be the pain for functional tests, as it may be
kompose convert -f /home/snarwade..... for me,

metadata:
    annotations:
      kompose.cmd: kompose convert -f /home/snarwade --stdout
      kompose.version: |
        1.0.0 (HEAD)

but for travis, kompose convert -f /home/travis...
it will be,

metadata:
    annotations:
      kompose.cmd: kompose convert -f /home/travis --stdout
      kompose.version: |
        1.0.0 (HEAD)

@cdrage
Copy link
Member

cdrage commented Jul 24, 2017

@surajnarwade Remove the pipe | from version and it's a 👍 from me.

@surajnarwade
Copy link
Contributor

@cdrage , what I mean is we have to write template for each and every functional test as kompose.cmd will be different for local and travis, is that okay ?

@cdrage
Copy link
Member

cdrage commented Jul 24, 2017

@surajnarwade Yup. Since you're adding annotations by default, you'll have to change every test. It's a pain-in-the-butt to do, but it's a must.

I think that's okay, right @kadel @surajssd ?

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

4 participants