Skip to content

Commit

Permalink
Fix propagating annotations to Gateway route (#1014)
Browse files Browse the repository at this point in the history
* Fix propagating annotations to Gateway route

Signed-off-by: Pavol Loffay <[email protected]>

* Changelog

Signed-off-by: Pavol Loffay <[email protected]>

---------

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Aug 26, 2024
1 parent f1b053e commit 903d0b4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .chloggen/fix-annotations-gateway-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
component: tempostack

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix setting annotations for Gateway route

# One or more tracking issues related to the change
issues: [1014]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
4 changes: 4 additions & 0 deletions internal/manifests/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ func TestBuildGateway_openshift(t *testing.T) {
Enabled: true,
Ingress: v1alpha1.IngressSpec{
Type: v1alpha1.IngressTypeRoute,
Annotations: map[string]string{
"timeout": "30s",
},
Route: v1alpha1.RouteSpec{
Termination: v1alpha1.TLSRouteTerminationTypePassthrough,
},
Expand Down Expand Up @@ -246,6 +249,7 @@ func TestBuildGateway_openshift(t *testing.T) {
require.True(t, ok)
require.Equal(t, "Service", route.Spec.To.Kind)
require.Equal(t, "tempo-simplest-gateway", route.Spec.To.Name)
require.Equal(t, map[string]string{"timeout": "30s"}, route.ObjectMeta.Annotations)

obj = getObjectByTypeAndName(objects, "tempo-simplest-gateway-cabundle", reflect.TypeOf(&corev1.ConfigMap{}))
require.NotNil(t, obj)
Expand Down
7 changes: 4 additions & 3 deletions internal/manifests/gateway/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ func route(tempo v1alpha1.TempoStack) (*routev1.Route, error) {

return &routev1.Route{
ObjectMeta: metav1.ObjectMeta{
Name: naming.Name(manifestutils.GatewayComponentName, tempo.Name),
Namespace: tempo.Namespace,
Labels: labels,
Name: naming.Name(manifestutils.GatewayComponentName, tempo.Name),
Namespace: tempo.Namespace,
Labels: labels,
Annotations: tempo.Spec.Template.Gateway.Ingress.Annotations,
},
Spec: routev1.RouteSpec{
Host: tempo.Spec.Template.Gateway.Ingress.Host,
Expand Down

0 comments on commit 903d0b4

Please sign in to comment.