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

Invalidating services when they contain check of type tcp and http bu… #1097

Merged
merged 2 commits into from
Apr 19, 2016

Conversation

diptanu
Copy link
Contributor

@diptanu diptanu commented Apr 15, 2016

…t no ports

@@ -1527,6 +1527,10 @@ func (s *Service) Validate() error {
}

for _, c := range s.Checks {
if s.PortLabel == "" && (c.Type == ServiceCheckTCP || c.Type == ServiceCheckHTTP) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be better to pass down the PortLabel information into the check? Or to add a method to the check which returns whether it requires a port. The inspection of the type seems hacky.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we validate the PortLabel exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dadgar I was wondering the same, but I thought since service block holds check blocks, it's the service block which is invalid if the check can't be supported because the service doesn't have certain capability. Validation of a check currently checks whether they have been configured correctly, for example, if a user specifies the type of the check as script, then command is mandatory.

@armon
Copy link
Member

armon commented Apr 19, 2016

LGTM

@dadgar dadgar merged commit 591b8b5 into master Apr 19, 2016
@dadgar dadgar deleted the service-no-port branch April 19, 2016 16:18
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants