Bug Report: Environment Reference Does Not Work as Documented
Summary
We have experienced two unexpected behaviors in environment handling.
Issue 1: Environments are Referenced by Name Field Instead of Identifier
Expected Behavior
Environments are referenced by their identifier (the YAML object key), according to the documentation.
Actual Behavior
Environments are actually referenced by their name field (the YAML object value).
Related codes:
- In
internal/storage/environments/git/store.go:98-99, the Key() method returns e.cfg.Name
- In
internal/config/environments.go:93, the configuration defaults set name to the YAML key identifier
- In
internal/server/environments/storage.go:217-227, the Get() method looks up environments by this key
Issue 2: Default Environment Cannot Be Customized When Environment Key is Unspecified
Expected Behavior (According to Documentation)
According to the documentation, when no environment is specified, the environment with default: true should be used, regardless of its identifier or name.
Actual Behavior
When no environment is specified in client initialization, environment with name "default" is used.
If no environment with name "default" exists, the server returns an error.
Related codes:
Environment
- Flipt v2.1.3
- Flipt Client SDKs for Python v1.3.1
Bug Report: Environment Reference Does Not Work as Documented
Summary
We have experienced two unexpected behaviors in environment handling.
Issue 1: Environments are Referenced by Name Field Instead of Identifier
Expected Behavior
Environments are referenced by their identifier (the YAML object key), according to the documentation.
Actual Behavior
Environments are actually referenced by their
namefield (the YAML object value).Related codes:
internal/storage/environments/git/store.go:98-99, theKey()method returnse.cfg.Nameinternal/config/environments.go:93, the configuration defaults setnameto the YAML key identifierinternal/server/environments/storage.go:217-227, theGet()method looks up environments by this keyIssue 2: Default Environment Cannot Be Customized When Environment Key is Unspecified
Expected Behavior (According to Documentation)
According to the documentation, when no environment is specified, the environment with
default: trueshould be used, regardless of its identifier or name.Actual Behavior
When no environment is specified in client initialization, environment with name
"default"is used.If no environment with name
"default"exists, the server returns an error.Related codes:
"default"as default environment keyEnvironment