Add NAIS source kind for instance group env vars#402
Merged
Conversation
…ser-defined Split the SPEC value in InstanceGroupValueSourceKind into SPEC (user-defined in nais.yaml .spec.env) and NAIS (injected by naiserator). Uses the Application CRD via AppWatcher to determine which inline env vars the user actually defined. fieldRef and resourceFieldRef are always classified as NAIS.
jhrv
commented
Apr 17, 2026
|
|
||
| """ | ||
| The value is defined inline in the workload spec. | ||
| The value is defined inline in the workload spec (user-defined in nais.yaml). |
Contributor
Author
There was a problem hiding this comment.
nais.yaml might not be right name, app.yaml
- Add APP_ENV to Application CRD spec.env so it's classified as SPEC - Add NAIS_APP_NAME to ReplicaSet pod spec only (not in CRD) to test NAIS classification - Update integration test expectations to cover both SPEC and NAIS env vars - Improve SPEC enum description: 'application manifest' instead of 'nais.yaml'
thokra-nav
approved these changes
Apr 17, 2026
jhrv
added a commit
to nais/cli
that referenced
this pull request
Apr 17, 2026
nais-api now distinguishes user-defined SPEC values from platform- injected NAIS values (see nais/api#402). Render NAIS-sourced entries as 'Nais/<name>' while keeping SPEC rendering unchanged. Rename 'ConfigMaps' to 'Configs' in 'nais app files' help text for consistency with the user-facing 'Config/<name>' rendering. Also fix the schema update tasks to use the promoted top-level 'api' command (was 'alpha api') so 'mise run update:graphql-schema:{live,local}' works again after the command promotion.
jhrv
added a commit
to nais/console-frontend
that referenced
this pull request
Apr 17, 2026
nais-api now returns a distinct NAIS source kind for platform-injected env vars and mounted files (see nais/api#402), so the client no longer needs to parse the application manifest YAML to classify SPEC entries. Stop fetching 'manifest { content }' on the instance group detail page, remove the 'yaml' import and the 'specEnvNames' derivation, and switch labeling directly on 'source.kind': - SECRET -> 'Secret' - CONFIG -> 'Config' (was 'ConfigMap') - SPEC -> 'Application manifest' - NAIS -> 'Nais' (fallback until schema.graphql is synced)
jhrv
added a commit
to nais/cli
that referenced
this pull request
Apr 17, 2026
nais-api now distinguishes user-defined SPEC values from platform- injected NAIS values (see nais/api#402). Render NAIS-sourced entries as 'Nais/<name>' while keeping SPEC rendering unchanged. Rename 'ConfigMaps' to 'Configs' in 'nais app files' help text for consistency with the user-facing 'Config/<name>' rendering. Also fix the schema update tasks to use the promoted top-level 'api' command (was 'alpha api') so 'mise run update:graphql-schema:{live,local}' works again after the command promotion.
jhrv
added a commit
to nais/console-frontend
that referenced
this pull request
Apr 17, 2026
nais-api now returns a distinct NAIS source kind for platform-injected env vars and mounted files (see nais/api#402), so the client no longer needs to parse the application manifest YAML to classify SPEC entries. Stop fetching 'manifest { content }' on the instance group detail page, remove the 'yaml' import and the 'specEnvNames' derivation, and switch labeling directly on 'source.kind': - SECRET -> 'Secret' - CONFIG -> 'Config' (was 'ConfigMap') - SPEC -> 'Application manifest' - NAIS -> 'Nais' (fallback until schema.graphql is synced)
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.
Summary
SPECinInstanceGroupValueSourceKindintoSPEC(user-defined in.spec.env) andNAIS(platform-injected by naiserator)AppWatcherto determine which inline env vars the user actually definedfieldRef/resourceFieldRefand projected volume subPath fallback are always classified asNAISNAISwhen Application CRD is not found (conservative default)This makes it easier for CLI and Console to distinguish platform-injected values from user-defined ones without client-side heuristics.