Repository navigation
Create dashboard ClusterProfile content in the namespace ui-backend runs in - #197
Merged
Merged
Conversation
…uns in ui-backend stored the ConfigMap of a ClusterProfile created from pasted YAML in a hardcoded `projectsveltos` namespace. When Sveltos is installed in a different namespace (for instance `sveltos`), that namespace does not exist and the creation fails. ui-backend now reads its own namespace from the `NAMESPACE` environment variable, set through the downward API (`metadata.namespace`), and creates the ConfigMap there. If the variable is not set, it falls back to `projectsveltos`, so existing manifests keep working. The namespace is not configurable through a flag: it always follows where ui-backend is deployed. A Profile still uses its own namespace. The env var is added to `config/manager/manager.yaml` and the regenerated `manifest/manifest.yaml`. Tests: the ClusterProfile case of `contentConfigMapNamespace` asserts the namespace from `NAMESPACE`, the ConfigMap creation test sets it, and a new test covers the fallback. Fixes projectsveltos#190
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ui-backend stored the ConfigMap of a ClusterProfile created from pasted YAML in a hardcoded
projectsveltosnamespace.When Sveltos is installed in a different namespace (for instance
sveltos), that namespace does not exist and the creation fails.ui-backend now reads its own namespace from the
NAMESPACEenvironment variable, set through the downward API (metadata.namespace), and creates the ConfigMap there. If the variable is not set, it falls back toprojectsveltos, so existing manifests keep working. The namespace is not configurable through a flag: it always follows where ui-backend is deployed. A Profile still uses its own namespace.The env var is added to
config/manager/manager.yamland the regeneratedmanifest/manifest.yaml.Tests: the ClusterProfile case of
contentConfigMapNamespaceasserts the namespace fromNAMESPACE, the ConfigMap creation test sets it, and a new test covers the fallback.Fixes #190