-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add warnings client side before deployment on Kubernetes #903
Add warnings client side before deployment on Kubernetes #903
Conversation
Codecov Report
@@ Coverage Diff @@
## master #903 +/- ##
=========================================
Coverage ? 53.37%
=========================================
Files ? 267
Lines ? 16975
Branches ? 0
=========================================
Hits ? 9060
Misses ? 7322
Partials ? 593 |
d470ec2
to
ccd068d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise, one question : why doing that on its own instead of doing it while converting the types.Config
to the stack
struct ?
"github.com/docker/cli/cli/compose/loader" | ||
composetypes "github.com/docker/cli/cli/compose/types" | ||
yaml "gopkg.in/yaml.v2" | ||
) | ||
|
||
func loadStack(name string, cfg composetypes.Config) (stack, error) { | ||
func loadStack(stderr io.Writer, name string, cfg *composetypes.Config) (stack, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: any reason for having stderr
as first argument ? 😝
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ccd068d
to
897717d
Compare
There are two reasons why I separated it. First one is for separation of concerns, as it's not a little 5 lines function. Second one is that if you put the warning code in the conversion code, then you may get warnings while you are retrieving some stacks, during a |
var buf bytes.Buffer | ||
warnUnsupportedFeatures(&buf, config) | ||
warnings := buf.String() | ||
assert.Contains(t, warnings, `top-level network "global" is ignored`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use a golden.Assert()
for all the warnings, or is it possible for the order to change? Maybe we could sort the output if the order changes?
897717d
to
fd995d5
Compare
PTAL |
fd995d5
to
8023cba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on commits that differs from #899
8023cba
to
87cce89
Compare
Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but when rebasing can you quash the last two commits?
…a compose file for deployment on Kubernetes. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
87cce89
to
36591a2
Compare
Rebase and squashing done. |
Thanks! Still LGTM |
- What I did
I added a bunch of warnings for all the compose features unsupported by the Kubernetes Stack API. They are printed on stderr like this:
- How I did it
Once the compose file is parsed, I iterate on all services to detect the unsupported features (which are filled) and print a warning on each.
- How to verify it
Find a compose file with some networks and deploy it. Some warnings should be printed on stderr.
- Description for the changelog
Print warnings on stderr for each unsupported features while parsing a compose file for deployment on Kubernetes.
- A picture of a cute animal (not mandatory but encouraged)
