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

Add check for missing path in client host_volume config #17393

Merged

Conversation

dttung2905
Copy link
Contributor

Hi team,

This PR aims to add additional check for missing path value in client host_volume config. I have added 2 more test cases to validate this change. Please let me know if I need to make any additional changes for this 🙏

Fixes : #16968

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dttung2905!

I left a quick question there just to make sure I'm not missing anything.

@@ -379,6 +379,15 @@ func (c *Command) IsValidConfig(config, cmdConfig *Config) bool {
return false
}

if !reflect.ValueOf(config.Client.HostVolumes).IsZero() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this condition necessary? If the list IsZero then the range below would be skipped anyway right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lgfa29,
Thanks for the super quick review! It is indeed redundant here .

Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for checking that 😄

I just pushed a commit to clarify the CHANGELOG entry a little with regards to which path it was referencing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nomad config validate does not check for missing host_volume directories and daemon fails to start
2 participants