Skip to content

Commit

Permalink
[OSSM-5611] Workaround for cleaning instability on OCP in PSI (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkralik3 authored Jan 11, 2024
1 parent c83c204 commit e768b2b
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 18 deletions.
Binary file added pkg/tests/ossm-federation/__debug_bin3043052675
Binary file not shown.
14 changes: 10 additions & 4 deletions pkg/tests/ossm-federation/federation_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type federationTest struct {
west config
east config

controlPlaneInstaller func(t TestHelper, ft federationTest)
controlPlaneInstaller func(t TestHelper, ft federationTest, ingressServiceType string)
bookinfoInstaller func(t TestHelper, ft federationTest)
checker func(t TestHelper, ft federationTest)
}
Expand All @@ -65,7 +65,12 @@ func (ft federationTest) run(t TestHelper) {
ocEast.CreateNamespace(t, ft.east.smcpNamespace, ft.east.bookinfoNamespace)

t.LogStep("Install control planes for west-mesh and east-mesh")
ft.controlPlaneInstaller(t, ft)

ingressServiceType := "LoadBalancer"
if singleCluster {
ingressServiceType = "ClusterIP"
}
ft.controlPlaneInstaller(t, ft, ingressServiceType)

t.LogStep("Wait for west-mesh and east-mesh installation to complete")
ocWest.WaitSMCPReady(t, ft.west.smcpNamespace, ft.west.smcpName)
Expand Down Expand Up @@ -155,10 +160,11 @@ func getRootCertificate(t TestHelper, c config) string {
return data[key]
}

func installSMCPandSMMR(t TestHelper, c config, smcpFile, smmrFile string) {
func installSMCPandSMMR(t TestHelper, c config, smcpFile, smmrFile string, ingressServiceType string) {
t.Logf("Install ServiceMeshControlPlane %s in namespace %s", c.smcpName, c.smcpNamespace)
c.oc.ApplyTemplateFile(t, c.smcpNamespace, smcpFile, map[string]string{
"Version": env.GetSMCPVersion().String(),
"Version": env.GetSMCPVersion().String(),
"IngressServiceType": ingressServiceType,
})

t.Log("Create ServiceMeshMemberRoll")
Expand Down
6 changes: 3 additions & 3 deletions pkg/tests/ossm-federation/federation_failover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ func TestMultiClusterFederationFailover(t *testing.T) {
region: eastRegion,
zone: eastZone,
},
controlPlaneInstaller: func(t TestHelper, ft federationTest) {
installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml")
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml")
controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) {
installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType)
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType)
},
bookinfoInstaller: func(t TestHelper, ft federationTest) {
t.LogStep("Install bookinfo in west-mesh")
Expand Down
12 changes: 6 additions & 6 deletions pkg/tests/ossm-federation/federation_traffic_splitting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func TestFederation(t *testing.T) {
smcpNamespace: "east-mesh-system",
bookinfoNamespace: "east-mesh-bookinfo",
},
controlPlaneInstaller: func(t TestHelper, ft federationTest) {
installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml")
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml")
controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) {
installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType)
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType)
},
bookinfoInstaller: defaultBookinfoInstaller,
checker: defaultChecker,
Expand All @@ -80,16 +80,16 @@ func TestFederationDifferentCerts(t *testing.T) {
smcpNamespace: "east-mesh-system",
bookinfoNamespace: "east-mesh-bookinfo",
},
controlPlaneInstaller: func(t TestHelper, ft federationTest) {
controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) {
t.Log("Create Secret 'cacerts' for custom CA certs in west-mesh")
ft.west.oc.CreateGenericSecretFromFiles(t, ft.west.smcpNamespace, "cacerts",
"testdata/cacerts/ca-cert.pem",
"testdata/cacerts/ca-key.pem",
"testdata/cacerts/root-cert.pem",
"testdata/cacerts/cert-chain.pem")

installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp_custom_cert.yaml", ft.testdataPath+"/west-mesh/smmr.yaml")
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml")
installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp_custom_cert.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType)
installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType)
},
bookinfoInstaller: defaultBookinfoInstaller,
checker: defaultChecker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
enabled: true
routerMode: sni-dnat
service:
type: LoadBalancer
type: {{ .IngressServiceType }}
metadata:
labels:
# to prevent west-mesh-ingress's service from including default ingress pods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
enabled: true
routerMode: sni-dnat
service:
type: LoadBalancer
type: {{ .IngressServiceType }}
metadata:
labels:
# to prevent east-mesh-ingress's service from including default ingress pods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
enabled: true
routerMode: sni-dnat
service:
type: LoadBalancer
type: {{ .IngressServiceType }}
metadata:
labels:
# to prevent west-mesh-ingress's service from including default ingress pods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
enabled: true
routerMode: sni-dnat
service:
type: LoadBalancer
type: {{ .IngressServiceType }}
metadata:
labels:
# to prevent east-mesh-ingress's service from including default ingress pods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
enabled: true
routerMode: sni-dnat
service:
type: LoadBalancer
type: {{ .IngressServiceType }}
metadata:
labels:
# to prevent east-mesh-ingress's service from including default ingress pods
Expand Down

0 comments on commit e768b2b

Please sign in to comment.