Update `atmos.Component` template function for `helmfile` components @aknysh (#1217)
what
- Update
atmos.Componenttemplate function forhelmfilecomponents - Add tests
- Update docs
why
atmos.Componenttemplate function allows reading any section or attribute from the component (vars,settings, etc.), including theoutputssection (Terraform state). Helmfile components don't have Terraform state. This PR adds detecting the component type (terraformorhelmfile) when executingatmos.Component, and don't try to read the remote state for thehelmfilecomponents
components:
# Terraform components
terraform:
component-1:
vars:
foo: "foo"
bar: "bar"
baz: "baz
component-2:
vars:
foo: '{{ (atmos.Component "component-1" .stack).outputs.foo }}'
bar: '{{ (atmos.Component "component-1" .stack).outputs.bar }}'
baz: '{{ (atmos.Component "component-1" .stack).outputs.bar }}--{{ (atmos.Component "component-1" .stack).outputs.baz }}'
# Helmfile components
helmfile:
component-3:
vars:
foo: '{{ (atmos.Component "component-1" .stack).vars.foo }}'
bar: '{{ (atmos.Component "component-1" .stack).vars.bar }}'
baz: '{{ (atmos.Component "component-1" .stack).vars.baz }}'
component-4:
vars:
foo: '{{ (atmos.Component "component-1" .stack).outputs.foo }}'
bar: '{{ (atmos.Component "component-3" .stack).vars.bar }}'
# Helmfile components don't have `outputs` (terraform output) - this should result in `<no value>` and not throwing errors
baz: '{{ (atmos.Component "component-3" .stack).outputs.baz }}'Refactor YAML Function Processing in `atmos.yaml`, Support `!env`, `!exec`,`!include`,!`repo-root` functions in `atmos.yaml` configuration files @haitham911 (#1202)
what
- Refactor YAML Function Processing in
atmos.yaml - Support
!env,!exec,!include,!repo-rootfunctions inatmos.yamlconfiguration files
why
- Added support for
!execdirective in configuration files enables dynamic configuration likeGITHUB_TOKEN: !exec <gh auth token> - Added support for
!envdirective in configuration files enables dynamic configuration - Added support for
!includedirective in configuration files enables dynamic configuration inatmos.yaml - Added support for
!repo-rootto retrieve the root directory of the Atmos repository. If the Git root is not found, it will return a default value if specified
Component Updater Docs @milldr (#1211)
what
- Use Steps and StepNumber conventions for component updater documentation
why
- This documentation was difficult to follow. Using these conventions makes it easier to follow
Replace `myapp` with `mock` component in tests @milldr (#1213)
what
- Delete all occurrences of
myappcomponent - Replaced with
mockcomponent
why
- The
myappcomponent was built with weather API. We were abusing this API for our tests, which isn't even necessary for what we want to test. The simplemockwith inputs and outputs is sufficient.