-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WIP: Feature/healthcheck signal #177
WIP: Feature/healthcheck signal #177
Conversation
@@ -68,6 +68,8 @@ func GetCommand(cmd instructions.Command, buildcontext string) (DockerCommand, e | |||
return &ArgCommand{cmd: c}, nil | |||
case *instructions.ShellCommand: | |||
return &ShellCommand{cmd: c}, nil | |||
case *instructions.HealthCheckCommand: | |||
return &HealthCheckCommand{cmd: c}, nil |
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.
From the build error, it looks like you'll have to translate from the dockerfile HealthCheck type to the go-containerregistry one.
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.
exactly. Just looking into how to do this the most efficiently.
Just creating a v1.HealthConfig and passing all values would work, but I wouldn't really regard this as future proof or clean tbh. Any alternatives you could think of?
So... I don't really like this way of doing it but it works and there is no way to convert struct to struct more fail-safe/ autonomous that I am aware of. |
Hmm, if the structs are actually equivalent you might be able to cast them: https://beta.golang.org/doc/go1.8#language That would then error if the types don't match which would probably be a good thing. |
This is the case as of now as well sadly:
On go 1.10 |
Hmm, that might be because one is a pointer and the other isn't. Could you give it one more try by dereferencing the h.cmd.Health before converting? |
Same thing:
EDIT: |
Nice! |
Solves #17