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

make flags global which are common #514

Closed
surajssd opened this issue Mar 27, 2017 · 9 comments
Closed

make flags global which are common #514

surajssd opened this issue Mar 27, 2017 · 9 comments

Comments

@surajssd
Copy link
Member

flags like replicas and other flags that are repeating should be implemented only once, which means make it global.

This came to my mind after reading #506

@kadel
Copy link
Member

kadel commented Mar 27, 2017

but replicas doesn't make sense for down command :-(

Shouldn't be global parameters valid for all (up,down,convert) commands?

@surajssd
Copy link
Member Author

@kadel didn't think about that! just thought about the repetition!

@kadel
Copy link
Member

kadel commented Mar 27, 2017

agreed that repetition is ugly, and we should figure out how to reuse flags between up and convert so we can define them in only one place.

But solution shouldn't be making it global, because that we will have to ignore some flags for commands where it doesn't make sense, and thist might be even more confusing :-(

@cdrage
Copy link
Member

cdrage commented Mar 29, 2017

I think we can remove the --emptyvols and --replicas flags from kompose down:

▶ kompose down --help
Delete instantiated services/deployments from kubernetes. (default "kubernetes")

Usage:
  kompose down [flags]

Flags:
      --emptyvols      Use Empty Volumes. Do not generate PVCs
      --replicas int   Specify the number of repliaces in the generate resource spec (default 1)

@kadel
Copy link
Member

kadel commented Mar 31, 2017

I think we can remove the --emptyvols and --replicas flags from kompose down:

yes we should do that.

but we still have same flags defined in two places.
for example --replicas is in up.go and in convert.go

@cdrage
Copy link
Member

cdrage commented Mar 31, 2017

@kadel Unfortunately I don't think there is a way to define a global parameter and remove it from only one particular one. Having it in both up.go and convert.go seems the best bet. At least it's better than how we did it with urfave/cli 👍

@kadel
Copy link
Member

kadel commented Apr 3, 2017

I've some ideas that might work, but I have to try it

@cdrage
Copy link
Member

cdrage commented Jul 19, 2017

Hey @kadel emptyvols and replicas was removed from Kompose down, should we close this issue or is there anything else we need to discuss to refactor this?

@cdrage
Copy link
Member

cdrage commented Aug 3, 2017

Going to close this for now, let's re-open at a later-date if we find a refactor for global flags 👍

@cdrage cdrage closed this as completed Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants