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

Backport of Validate that Connect Native services define a port into release/1.9.x #24331

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #24329 to be assessed for backporting due to the inclusion of the label backport/1.9.x.

The below text is copied from the body of the original PR.


This PR adds a validation check for PortLabels on Connect Native enabled services. This is a requirement in Consul and if missing from the job spec will continually error.

"service": "nomad",
"message": "failed to update services in Consul",
"attributes": {
    "hostname": "<snip>",
    "@level": "warn",
    "@timestamp": "2024-10-29T15:16:34.148322Z",
    "service": "nomad",
    "@module": "consul.sync",
    "error": "Unexpected response code: 400 (Validation failed: 1 error occurred:\n\t* Port or SocketPath must be set for a Connect native service.)",
    "status": "info",
}

I can't get all of the tests to pass locally but TestService_Validate looked good.

=== RUN   TestService_Validate
=== PAUSE TestService_Validate
=== CONT  TestService_Validate
=== RUN   TestService_Validate/base_service
=== RUN   TestService_Validate/Native_Connect_without_task_name
=== RUN   TestService_Validate/Native_Connect_with_task_name
=== RUN   TestService_Validate/Native_Connect_without_port
=== RUN   TestService_Validate/Native_Connect_with_port
=== RUN   TestService_Validate/Native_Connect_with_Sidecar
=== RUN   TestService_Validate/provider_nomad_with_checks
=== RUN   TestService_Validate/provider_nomad_with_invalid_check_type
=== RUN   TestService_Validate/provider_nomad_with_tls_skip_verify
=== RUN   TestService_Validate/provider_nomad_with_connect
=== RUN   TestService_Validate/provider_nomad_valid
=== RUN   TestService_Validate/provider_consul_with_notes_too_long
--- PASS: TestService_Validate (0.00s)
    --- PASS: TestService_Validate/base_service (0.00s)
    --- PASS: TestService_Validate/Native_Connect_without_task_name (0.00s)
    --- PASS: TestService_Validate/Native_Connect_with_task_name (0.00s)
    --- PASS: TestService_Validate/Native_Connect_without_port (0.00s)
    --- PASS: TestService_Validate/Native_Connect_with_port (0.00s)
    --- PASS: TestService_Validate/Native_Connect_with_Sidecar (0.00s)
    --- PASS: TestService_Validate/provider_nomad_with_checks (0.00s)
    --- PASS: TestService_Validate/provider_nomad_with_invalid_check_type (0.00s)
    --- PASS: TestService_Validate/provider_nomad_with_tls_skip_verify (0.00s)
    --- PASS: TestService_Validate/provider_nomad_with_connect (0.00s)
    --- PASS: TestService_Validate/provider_nomad_valid (0.00s)
    --- PASS: TestService_Validate/provider_consul_with_notes_too_long (0.00s)
PASS

Overview of commits

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/validate-connect-native-port/perfectly-boss-treefrog branch from 096d9e6 to f1f0678 Compare October 29, 2024 21:03
@schmichael schmichael requested review from schmichael and removed request for oulman October 29, 2024 21:07
@schmichael schmichael merged commit f8e5ece into release/1.9.x Oct 29, 2024
20 checks passed
@schmichael schmichael deleted the backport/validate-connect-native-port/perfectly-boss-treefrog branch October 29, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants