-
Notifications
You must be signed in to change notification settings - Fork 771
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
Validate dockerfilepath in buildconfig #609
Validate dockerfilepath in buildconfig #609
Conversation
d86feee
to
08b8198
Compare
hmm, I can't make it work :-( version: "2"
services:
foo:
build:
context: "./build"
dockerfile: /Dockerfile
image: "tomaskral/foobar"
command: "sleep 3600" output:
|
@surajnarwade same issue as @kadel
|
08b8198
to
f5899b8
Compare
@ashetty1 can you see if this PR works for you and solve your issue then we can go ahead with it, otherwise the code LGTM, but if @ashetty1 gives a +1 we can merge it, also @surajnarwade can you please also write command line tests? |
pkg/loader/compose/compose.go
Outdated
@@ -330,6 +330,11 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) { | |||
envs := loadEnvVars(composeServiceConfig.Environment) | |||
serviceConfig.Environment = envs | |||
|
|||
//Validate dockerfile path | |||
if filepath.IsAbs(serviceConfig.Dockerfile) { | |||
log.Fatalf("%q defined in service %q is absolute path, it must be a relative path.", serviceConfig.Dockerfile, name) |
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.
Grammar error.
%q is an absolute path
is better.
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.
Other than my small note (and a command line test being added), LGTM.
f5899b8
to
539d0fa
Compare
This PR will resolve kubernetes#594 by validating dockerfilepath based on whether it is relative path or not.
539d0fa
to
581e181
Compare
LGTM @surajnarwade |
LGTM |
This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.