GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — feat: parse healthcheck in dockerfile by seongm-1 · Pull Request #971 · aws/copilot-cli
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Conversation
|
| } | ||
|
|
||
| // parse takes a Dockerfile and fills in struct members based on methods like parseExpose and (TODO) parseHealthcheck | ||
| // parse takes a Dockerfile and fills in struct members based on methods like parseExpose and parseHealthcheck |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences
Comments should begin with the name of the thing being described and end in a period
This wiki page is pretty neat and contains all sorts of best-practices, if you'd like to take a look when you've time :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🚀 tiny nits! once addressed feel free to remove the "do-not-merge" label and mergify can auto-merge after 2 approvals 😁.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| inst := fmt.Sprint(instruction) | ||
|
|
||
| // Getting the value at a children will return the Dockerfile directive | ||
| switch d := child.Value; d { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I really like what you did with ParseInstruction! I just realized that the instruction itself is already parsed into a moby type and we don't need to parse it again :D
Can try something like this:
var hc *HealthCheck switch t := instruction.(type); t { case *instructions.ExposeCommand: // Read fields from t. case *instructions.HealthCheckCommand: hc = &HealthCheck{ interval: uint16(t.Health.Interval.Seconds()), // ... same for other fields } }
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Talked about it offline and it provided a compiler error. Might have to tackle this later on.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sounds good but I think it's worthwhile addressing it because it will significantly remove code from us and will keep it in sync with how Docker parses the file.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🚢
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.