Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 35fd587

Browse files
committed
contour envoy: Verify if hostPort does not exist
Check if the converted config does not contain the hostPort. Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
1 parent 27d2b39 commit 35fd587

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/components/contour/component_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package contour
1616

1717
import (
18+
"strings"
1819
"testing"
1920

2021
"github.com/kinvolk/lokomotive/pkg/components/internal/testutil"
@@ -129,3 +130,18 @@ func TestConversion(t *testing.T) {
129130
})
130131
}
131132
}
133+
134+
func TestEnvoyHostPort(t *testing.T) {
135+
t.Parallel()
136+
137+
componentCfg := `component "contour" {}`
138+
expectedManifestName := testutil.ObjectMetadata{Version: "apps/v1", Kind: "DaemonSet", Name: "envoy"}
139+
140+
component := NewConfig()
141+
m := testutil.RenderManifests(t, component, Name, componentCfg)
142+
gotConfig := testutil.ConfigFromMap(t, m, expectedManifestName)
143+
144+
if strings.Contains(gotConfig, "hostPort") {
145+
t.Fatalf("Did not expect to have hostPort, but the envoy Daemonset contains hostPort.")
146+
}
147+
}

0 commit comments

Comments
 (0)