Skip to content

Commit

Permalink
[no-cluster-rbac] OSSM-796: add SMMR integration test (maistra#458) (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
jewertow committed Aug 29, 2022
1 parent 082fc90 commit 5c2b576
Show file tree
Hide file tree
Showing 25 changed files with 17,887 additions and 21 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ require (
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65
k8s.io/kubectl v0.23.5
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
maistra.io/api v0.0.0-20220301154558-8f6a12a9464b
sigs.k8s.io/controller-runtime v0.11.2
sigs.k8s.io/gateway-api v0.4.1-0.20220419214231-03f50b47814e
sigs.k8s.io/mcs-api v0.1.0
Expand Down Expand Up @@ -228,7 +229,7 @@ require (
go.starlark.net v0.0.0-20211013185944-b0039bd2cfe3 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.9 // indirect
Expand Down
54 changes: 53 additions & 1 deletion go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,17 @@ rules:
resources: ["secrets"]
verbs: ["get", "watch", "list"]

# Maistra specific
- apiGroups: ["maistra.io"]
resources: ["servicemeshmemberrolls"]
verbs: ["get", "list", "watch"]
- apiGroups: ["route.openshift.io"]
resources: ["routes", "routes/custom-host"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: ["maistra.io"]
resources: ["servicemeshextensions"]
verbs: ["get", "list", "watch"]

# Used for MCS serviceexport management
- apiGroups: ["multicluster.x-k8s.io"]
resources: ["serviceexports"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ rules:
resources: ["secrets"]
verbs: ["get", "watch", "list"]

# Maistra specific
- apiGroups: ["maistra.io"]
resources: ["servicemeshmemberrolls"]
verbs: ["get", "list", "watch"]
- apiGroups: ["route.openshift.io"]
resources: ["routes", "routes/custom-host"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: ["maistra.io"]
resources: ["servicemeshextensions"]
verbs: ["get", "list", "watch"]

# Used for MCS serviceexport management
- apiGroups: ["{{ $mcsAPIGroup }}"]
resources: ["serviceexports"]
Expand Down
11 changes: 11 additions & 0 deletions manifests/charts/istiod-remote/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,17 @@ rules:
resources: ["secrets"]
verbs: ["get", "watch", "list"]

# Maistra specific
- apiGroups: ["maistra.io"]
resources: ["servicemeshmemberrolls"]
verbs: ["get", "list", "watch"]
- apiGroups: ["route.openshift.io"]
resources: ["routes", "routes/custom-host"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: ["maistra.io"]
resources: ["servicemeshextensions"]
verbs: ["get", "list", "watch"]

# Used for MCS serviceexport management
- apiGroups: ["{{ $mcsAPIGroup }}"]
resources: ["serviceexports"]
Expand Down
6 changes: 4 additions & 2 deletions pilot/pkg/config/kube/ingressv1/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ func (c *controller) SetWatchErrorHandler(handler func(r *cache.Reflector, err e
if err := c.ingressInformer.SetWatchErrorHandler(handler); err != nil {
errs = multierror.Append(err, errs)
}
if err := c.classes.Informer().SetWatchErrorHandler(handler); err != nil {
errs = multierror.Append(err, errs)
if c.classes != nil {
if err := c.classes.Informer().SetWatchErrorHandler(handler); err != nil {
errs = multierror.Append(err, errs)
}
}
return errs
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,9 @@ func (c *client) RunAndWait(stop <-chan struct{}) {
if features.EnableGatewayAPI {
c.gatewayapiInformer.Start(stop)
}
if c.memberRoll != nil {
c.memberRoll.Start(stop)
}
c.extInformer.Start(stop)
if c.fastSync {
// WaitForCacheSync will virtually never be synced on the first call, as its called immediately after Start()
Expand Down
39 changes: 39 additions & 0 deletions tests/integration/servicemesh/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//go:build integ
// +build integ

// Copyright Red Hat, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package servicemesh

import (
"testing"

"istio.io/istio/pkg/test/framework"
"istio.io/istio/pkg/test/framework/components/istio"
"istio.io/istio/tests/integration/servicemesh/maistra"
)

var i istio.Instance

func TestMain(m *testing.M) {
// do not change order of setup functions
framework.
NewSuite(m).
RequireMaxClusters(1).
Setup(maistra.ApplyServiceMeshCRDs).
Setup(istio.Setup(&i, nil)).
Setup(maistra.Install).
Run()
}
Loading

0 comments on commit 5c2b576

Please sign in to comment.