github cloudposse/atmos v1.206.2

5 hours ago
fix: prevent AWS_PROFILE from being treated as Atmos config profile @aknysh (#2077)

what

  • Fix a critical bug where setting AWS_PROFILE environment variable caused all Atmos commands (including atmos version) to fail with a "profile not found" error
  • The EKS command's Viper key bindings are now namespaced under eks.* to prevent collision with global flags
  • Add comprehensive regression tests and fix documentation

why

  • The aws eks update-kubeconfig command registered a local profile flag bound to AWS_PROFILE on the global Viper instance, overwriting the global profileATMOS_PROFILE binding
  • Since all Go init() functions run at startup (not at command execution time), this collision affected every command, not just the EKS command
  • When AWS_PROFILE was set (standard practice in AWS environments), getProfilesFromFlagsOrEnv() would pick up the AWS profile name and try to load it as an Atmos configuration profile, failing with "profile not found"
  • Multiple users reported this issue after upgrading to v1.206.0

Root cause

cmd/aws/eks/update_kubeconfig.go init() called updateKubeconfigParser.BindToViper(viper.GetViper()) which bound BindEnv("profile", "ATMOS_AWS_PROFILE", "AWS_PROFILE") on the global Viper, overwriting the earlier global binding BindEnv("profile", "ATMOS_PROFILE"). In Viper, the last BindEnv call for a given key wins.

Fix

Added flags.WithViperPrefix("eks") to the NewStandardParser() call so all EKS Viper keys are namespaced (e.g., eks.profile instead of profile). The EKS command reads flags from Cobra pflags directly, not from Viper, so the prefix has no functional impact on the command itself.

Files changed

File Change
cmd/aws/eks/update_kubeconfig.go Added WithViperPrefix("eks") to namespace EKS Viper keys
cmd/aws/eks/update_kubeconfig_test.go Added 6 regression tests for Viper prefix isolation
internal/exec/aws_eks_update_kubeconfig_test.go Added 3 test functions (9 subtests) for flag parsing — coverage 0% → 82.4%
pkg/flags/standard_test.go Added BindFlagsToViper_WithPrefix test (3 subtests) — coverage 62.5% → 75%
pkg/config/load_profile_test.go Added 7 test functions (18 subtests) for profile resolution regression
docs/fixes/2026-02-13-aws-profile-env-var-collision.md Fix documentation with root cause analysis

references

  • Closes #2076
  • Related to #2071 (same reporter, auth realm isolation issues)
  • Follow-up to #2075 (auth realm isolation fixes in v1.206.1)
  • Fix document: docs/fixes/2026-02-13-aws-profile-env-var-collision.md

Summary by CodeRabbit

  • Bug Fixes

    • Resolved an AWS_PROFILE environment-variable collision: EKS kubeconfig now isolates its profile settings to prevent global profile pollution and related "profile not found" errors.
  • Tests

    • Added broad regression and unit tests covering env-var binding, flag parsing, namespaced profile behavior, and collision scenarios.
  • Documentation

    • Added an article explaining the collision, root cause, and the applied isolation fix.
fix: correct devcontainer config structure in docs (#2068) @osterman (#2074)

what

  • Fixed blog post and command docs showing incorrect devcontainer config structure
  • Devcontainer is a top-level atmos.yaml key, not nested under components:
  • Clarified that both inline YAML config and devcontainer.json imports are supported
  • Embedded working example in blog post for better discoverability
  • Updated 8 YAML code blocks across 2 files

why

Users were unable to follow the blog post instructions and spent significant time debugging (issue #2068). The outdated docs incorrectly nested devcontainer configuration under components:, conflicting with the actual schema and causing confusion about whether to use .json or atmos.yaml files. Both are now properly supported and documented.

references

Closes #2068

Summary by CodeRabbit

  • Documentation

    • Simplified devcontainer docs to show a flat, top-level devcontainer configuration in atmos.yaml.
    • Updated CLI reference, examples, blog posts, and embedded demo to match the new format; flattened shell-alias examples.
    • Removed outdated “Real-World Workflows”, “Supported Fields”, and container-naming guidance.
    • Cleaned devcontainer example README by removing deprecated sections.
  • Chores

    • Added URL exclusion patterns to lychee configuration.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.