Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,13 @@ helm-test-unittest: $(HELM_UNITTEST_PLUGIN) helm/charts/.stamp
helm-test: ## Run all Helm validation tests
helm-test: helm-test-schema helm-test-subchart helm-test-unittest helm-test-template

# Istio template test requires Istio CRD API versions to be available
tests/helm/template/istio.yaml: tests/helm/template/istio-overrides.yml helm/charts/.stamp helm/values.schema.json $(wildcard helm/templates/*.yaml) $(wildcard helm/templates/*.tpl) helm/values.yaml
$(call LOG,HELM,template $@)
$(Q)$(HELM_CMD) template --kube-version "$(KUBE_VERSION)" "$(HELM_SCHEMA_TEST_TARGET)" --namespace "$(HELM_SCHEMA_TEST_NAMESPACE)" \
--api-versions networking.istio.io/v1 \
./helm --values $< > $@

tests/helm/template/%.yaml: tests/helm/template/%-overrides.yml helm/charts/.stamp helm/values.schema.json $(wildcard helm/templates/*.yaml) $(wildcard helm/templates/*.tpl) helm/values.yaml
$(call LOG,HELM,template $@)
$(Q)$(HELM_CMD) template --kube-version "$(KUBE_VERSION)" "$(HELM_SCHEMA_TEST_TARGET)" --namespace "$(HELM_SCHEMA_TEST_NAMESPACE)" ./helm --values $< > $@
Expand Down
3 changes: 2 additions & 1 deletion app/config/validator/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
DiagnosticScrapeConfig string = "scrape_cfg"
DiagnosticInsightsIngress string = "webhook_server_reachable"
DiagnosticAgentSettings string = "agent_settings"
DiagnosticIstioXClusterLB string = "istio_xcluster_lb"
)

const (
Expand All @@ -36,7 +37,7 @@ func IsValidDiagnostic(d string) bool {
DiagnosticK8sNamespace, DiagnosticK8sProvider,
DiagnosticKMS, DiagnosticScrapeConfig,
DiagnosticPrometheusVersion, DiagnosticInsightsIngress,
DiagnosticAgentSettings:
DiagnosticAgentSettings, DiagnosticIstioXClusterLB:
return true
}
return false
Expand Down
27 changes: 20 additions & 7 deletions app/config/validator/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,26 @@ import (

type Settings struct {
ExecutionContext Context
Logging Logging `yaml:"logging"`
Deployment Deployment `yaml:"deployment"`
Versions Versions `yaml:"versions"`
Cloudzero Cloudzero `yaml:"cloudzero"`
Prometheus Prometheus `yaml:"prometheus"`
Diagnostics Diagnostics `yaml:"diagnostics"`
Services Services `yaml:"services"`
Logging Logging `yaml:"logging"`
Deployment Deployment `yaml:"deployment"`
Versions Versions `yaml:"versions"`
Cloudzero Cloudzero `yaml:"cloudzero"`
Prometheus Prometheus `yaml:"prometheus"`
Diagnostics Diagnostics `yaml:"diagnostics"`
Services Services `yaml:"services"`
Integrations Integrations `yaml:"integrations"`
}

// Integrations contains configuration for third-party integrations
type Integrations struct {
Istio Istio `yaml:"istio"`
}

// Istio contains Istio service mesh integration settings
type Istio struct {
// ClusterID is the Istio cluster ID from Helm values (integrations.istio.clusterID).
// Used to validate cluster-local routing configuration in multi-cluster meshes.
ClusterID string `yaml:"cluster_id"`
}

type Services struct {
Expand Down
2 changes: 2 additions & 0 deletions app/domain/diagnostic/catalog/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
config "github.com/cloudzero/cloudzero-agent/app/config/validator"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic/cz"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic/istio"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic/k8s/namespace"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic/k8s/provider"
"github.com/cloudzero/cloudzero-agent/app/domain/diagnostic/k8s/version"
Expand Down Expand Up @@ -55,6 +56,7 @@ func createRegistry(ctx context.Context, c *config.Settings) *registry {
r.add(config.DiagnosticScrapeConfig, false, promcfg.NewProvider(ctx, c))
r.add(config.DiagnosticPrometheusVersion, false, promver.NewProvider(ctx, c))
r.add(config.DiagnosticInsightsIngress, false, webhook.NewProvider(ctx, c))
r.add(config.DiagnosticIstioXClusterLB, false, istio.NewProvider(ctx, c))

// Internal diagnostics emitted based on stage
r.add(config.DiagnosticInternalInitStart, true, stage.NewProvider(ctx, c, status.StatusType_STATUS_TYPE_INIT_STARTED))
Expand Down
2 changes: 1 addition & 1 deletion app/domain/diagnostic/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ func TestRegistry_List(t *testing.T) {

// Test listing providers
providers := r.List()
assert.Len(t, providers, 8) // Update the expected length to 8
assert.Len(t, providers, 9)
}
Loading
Loading