Skip to content

Commit

Permalink
remove run labels
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Quick <jared.quick@salesforce.com>
  • Loading branch information
jquick committed Feb 28, 2024
1 parent 39680d7 commit 9104607
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ If set to true, adds useful Docker labels to the primary container. See [Contain

The default is `true`.

#### `labels` (run only, string or array)

A list of KEY=VALUE that are passed through as service labels when image is being ran. These will be merged with any service labels defined in the compose file.

#### `build-labels` (build only, string or array)

A list of KEY=VALUE that are passed through as service labels when image is being built. These will be merged with any service labels defined in the compose file.
Expand Down
4 changes: 0 additions & 4 deletions commands/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ if [[ "$(plugin_read_config RUN_LABELS "true")" =~ ^(true|on|1)$ ]]; then
)
fi

while read -r label ; do
[[ -n "${label:-}" ]] && run_params+=("--label" "${label}")
done <<< "$(plugin_read_list LABELS)"

# append env vars provided in ENV or ENVIRONMENT, these are newline delimited
while IFS=$'\n' read -r env ; do
[[ -n "${env:-}" ]] && run_params+=("-e" "${env}")
Expand Down
4 changes: 0 additions & 4 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ configuration:
type: boolean
graceful-shutdown:
type: boolean
labels:
type: [ string, array ]
minimum: 1
leave-volumes:
type: boolean
mount-buildkite-agent:
Expand Down Expand Up @@ -157,7 +154,6 @@ configuration:
environment: [ run ]
expand-volume-vars: [ volumes ]
graceful-shutdown: [ run ]
labels: [ run ]
leave-volumes: [ run ]
mount-buildkite-agent: [ run ]
mount-checkout: [ run ]
Expand Down
25 changes: 0 additions & 25 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1280,28 +1280,3 @@ cmd3"
assert_output --partial "env-propagation-list desired, but LIST_OF_VARS is not defined!"
unstub buildkite-agent
}

@test "Run with a list of propagated labels" {
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_LABELS_0="com.buildkite.test=test"
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_LABELS_1="com.buildkite.test2=test2"
export BUILDKITE_COMMAND="echo hello world"

export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CHECK_LINKED_CONTAINERS=false

stub docker \
"compose -f docker-compose.yml -p buildkite1111 up -d --scale myservice=0 myservice : echo ran myservice dependencies" \
"compose -f docker-compose.yml -p buildkite1111 run --name buildkite1111_myservice_build_1 --label com.buildkite.test=test --label com.buildkite.test2=test2 -T --rm myservice /bin/sh -e -c 'echo hello world' : echo ran myservice"

stub buildkite-agent \
"meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1"

run "$PWD"/hooks/command

assert_success
refute_output --partial "Pulling"
assert_output --partial "ran myservice"

unstub docker
unstub buildkite-agent
}

0 comments on commit 9104607

Please sign in to comment.