-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for img labels and anno. in build create cmd
This adds support to specify labels and annotation for output image. There are 2 flags added for the `build create` command - output-image-label - output-image-annotation Signed-off-by: Shivam Mukhade <[email protected]>
- Loading branch information
Shivam Mukhade
committed
Nov 2, 2021
1 parent
9a759d6
commit 63693a2
Showing
6 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bats | ||
|
||
source test/e2e/helpers.sh | ||
|
||
setup() { | ||
load 'bats/support/load' | ||
load 'bats/assert/load' | ||
load 'bats/file/load' | ||
} | ||
|
||
teardown() { | ||
run kubectl delete builds.shipwright.io --all | ||
run kubectl delete buildruns.shipwright.io --all | ||
} | ||
|
||
@test "shp output image labels and annotation lifecycle" { | ||
# generate random names for our build and buildrun | ||
build_name=$(random_name) | ||
buildrun_name=$(random_name) | ||
|
||
# create a Build with a label and an annotation | ||
run shp build create ${build_name} --source-url=https://github.com/shipwright-io/sample-go --output-image=my-image --output-image-label=foo=bar --output-image-annotation=created-by=shipwright | ||
assert_success | ||
|
||
# ensure that the build was successfully created | ||
assert_output --partial "Created build \"${build_name}\"" | ||
|
||
# get the yaml for the Build object | ||
run kubectl get builds.shipwright.io/${build_name} -o yaml | ||
assert_success | ||
|
||
# ensure that the label and annotation were inserted into the Build object | ||
assert_output --partial "foo: bar" | ||
assert_output --partial "created-by: shipwright" | ||
} |