Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed validations for details, load configs for all namespaces #7296

Merged
merged 2 commits into from Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions business/checkers/virtualservices/no_gateway_checker_test.go
Expand Up @@ -131,6 +131,26 @@ func TestFoundGateway(t *testing.T) {
assert.Empty(vals)
}

func TestFoundRemoteGateway(t *testing.T) {
assert := assert.New(t)
conf := config.NewConfig()
config.Set(conf)

virtualService := data.AddGatewaysToVirtualService([]string{"remote/my-gateway", "mesh"}, data.CreateVirtualService())
gatewayNames := kubernetes.GatewayNames([]*networking_v1beta1.Gateway{
data.CreateEmptyGateway("my-gateway", "remote", make(map[string]string)),
})

checker := NoGatewayChecker{
VirtualService: virtualService,
GatewayNames: gatewayNames,
}

vals, valid := checker.Check()
assert.True(valid)
assert.Empty(vals)
}

func TestFoundGatewayTwoPartNaming(t *testing.T) {
assert := assert.New(t)
conf := config.NewConfig()
Expand Down
4 changes: 3 additions & 1 deletion business/istio_validations.go
Expand Up @@ -8,6 +8,8 @@ import (
networking_v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1"
security_v1beta "istio.io/client-go/pkg/apis/security/v1beta1"

meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/kiali/kiali/business/checkers"
"github.com/kiali/kiali/business/references"
"github.com/kiali/kiali/config"
Expand Down Expand Up @@ -419,7 +421,7 @@ func (in *IstioValidationsService) fetchIstioConfigList(ctx context.Context, rVa
IncludeK8sGateways: true,
IncludeK8sReferenceGrants: true,
}
istioConfigMap, err := in.businessLayer.IstioConfig.GetIstioConfigMap(ctx, namespace, criteria)
istioConfigMap, err := in.businessLayer.IstioConfig.GetIstioConfigMap(ctx, meta_v1.NamespaceAll, criteria)
if err != nil {
errChan <- err
return
Expand Down
11 changes: 11 additions & 0 deletions frontend/cypress/integration/featureFiles/istio_config.feature
Expand Up @@ -281,6 +281,17 @@ Feature: Kiali Istio Config page
When user selects the "sleep" namespace
Then the "foo" "VirtualService" of the "sleep" namespace should have a "danger"

@crd-validation
@bookinfo-app
@sleep-app
Scenario: VirtualService references to Gateway
Given there is a "foo" Gateway on "bookinfo" namespace for "productpage.local" hosts on HTTP port 80 with "app=productpage" labels selector
And there is a "foo" VirtualService in the "sleep" namespace with a "foo-route" http-route to host "sleep"
And the VirtualService applies to "sleep" hosts
And the VirtualService references "bookinfo/foo" gateways
When user selects the "sleep" namespace
Then the "foo" "VirtualService" of the "sleep" namespace should have a "success"

@crd-validation
@bookinfo-app
@sleep-app
Expand Down