Skip to content

Feature request: No clobber of existing environment variables #402

@mjsqu

Description

@mjsqu

When chamber is used to populate environment variables into a Elastic Container Services (ECS) task, you are able to add environment variables to the command using containerOverrides:

{
  "containerOverrides": [
    {
      "name": "string",
      "command": ["chamber","exec","<service>" ...],
      "environment": [
        {
          "name": "CLOBBERED_BY_CHAMBER",
          "value": "oops"
        }
        ...
      ]
    }
    ...
  ],
  "taskRoleArn": "string"
}

However, if you are running a chamber command these environment variables are overwritten if they exist in the service.

It would be good to be able to do:

chamber exec --noclobber <service>

And have chamber not overwrite and environment variables that are already set. An update to the way 'collisions' are handled in the code should achieve this.

To this end, --noclobber sits alongside the existing --pristine and --strict switches and should not be used with them as it works in the opposite way:

  • --strict and --noclobber - Should raise an error, these switches do pretty much the opposite of each other, --strict requiring the variables be set and --noclobber telling chamber not to overwrite them
  • --pristine and --noclobber - Should also error, --noclobber is allowing existing values to come through, --pristine explicitly prevents them from being inherited

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions