Skip to content

Commit

Permalink
Add missing scheme to ServiceMonitor
Browse files Browse the repository at this point in the history
The commit db30aab attempted to add TLS
to the service monitor but it forgot to change the scheme to https and
this was noticed during QE for the ticket associated with that commit

Solves MGMT-14756
  • Loading branch information
omertuc committed Nov 7, 2023
1 parent 8eca4e2 commit 351b67d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ func newServiceMonitor(ctx context.Context, log logrus.FieldLogger, asc ASC) (cl

addAppLabel(serviceName, &sm.ObjectMeta)
sm.Spec.Endpoints = []monitoringv1.Endpoint{{
Port: serviceName,
Port: serviceName,
Scheme: "https",
TLSConfig: &monitoringv1.TLSConfig{
CAFile: "/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt",
SafeTLSConfig: monitoringv1.SafeTLSConfig{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ var _ = Describe("newServiceMonitor", func() {
Expect(len(found.Spec.Endpoints)).To(Equal(1))
endpoint := found.Spec.Endpoints[0]
Expect(endpoint.TLSConfig.CAFile).To(Equal("/etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt"))
Expect(endpoint.Scheme).To(Equal("https"))
Expect(endpoint.TLSConfig.ServerName).To(Equal("assisted-service.test-namespace.svc"))
})
})
Expand Down

0 comments on commit 351b67d

Please sign in to comment.