Skip to content

cozystack-basics fails when every package that creates cozy-monitoring is disabled #4810

Description

Symptom

Basics fails to install when all three packages that create the monitoring namespace are disabled and root monitoring is left at its default. With monitoring.rootEnabled: true, putting cozystack.metrics-server, cozystack.monitoring-agents and cozystack.monitoring into bundles.disabledPackages makes cozystack-basics fail with namespaces "cozy-monitoring" not found. Every package that depends on basics then never installs.

Mechanism

Basics writes into a namespace it does not own. When _cluster.monitoring-enabled is true, monitoring-external-services.yaml renders three ExternalName Services into cozy-monitoring: vlinsert-generic, vminsert-shortterm and vminsert-longterm. The operator creates that namespace only while reconciling a Package with a component installed there, and only the three packages above have one. With all three disabled, the namespace never exists.

No dependency covers this. Basics has no dependsOn on any of the three packages, so the closure check proposed in #3389 would not catch it either.

E2E ran into it first. For narrow suite selections like vminstance or the Kubernetes suites, hack/select-install.sh --disabled drops all three packages. The E2E install now sets rootEnabled: false to match the root tenant, but a user's own disabledPackages list can still reach the same state.

Possible fixes

The simplest one is for basics to skip the redirects when none of the three packages is emitted. The platform chart knows the emitted set and could fold it into _cluster.monitoring-enabled.

The other option is to fail the platform render when monitoring.rootEnabled is true and all three packages are disabled. The error would then show up at render time and name the cause.

A lookup on the namespace won't work. Basics only re-renders on install, upgrade or a values change, so the result goes stale, and the template comment already says so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-triageIndicates an issue needs triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions