Skip to content

Commit

Permalink
Chore
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
  • Loading branch information
corneliusweig committed Jul 24, 2021
1 parent 5659fcb commit 257274a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ jobs:

- name: Create PR in krew-index
if: contains(github.ref, 'tags')
uses: rajatjindal/krew-release-bot@v0.0.36
uses: rajatjindal/krew-release-bot@v0.0.40
with:
krew_template_file: .konfig.yaml
4 changes: 2 additions & 2 deletions konfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ error() {
}

merge() {
if [[ "$1" =~ ^-(.*) && "$1" != '-p' && "$1" != '--preserve-structure' ]]; then
if [[ "$1" =~ ^-.+ && "$1" != '-p' && "$1" != '--preserve-structure' ]]; then
error "unrecognized flag \"$1\""
else
IFS=$':\n\t'
Expand Down Expand Up @@ -139,7 +139,7 @@ export_contexts() {
if [[ "$1" == '--kubeconfig' || "$1" == '-k' ]]; then
cfgs+=( "${2//,/:}" )
shift 2
elif [[ "$1" =~ ^-(.*) ]]; then
elif [[ "$1" =~ ^-.+ ]]; then
error "unrecognized flag \"$1\""
else
ctxs+=( "$1" )
Expand Down
12 changes: 11 additions & 1 deletion test/konfig.bats
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ load common
[[ $(check_fixture 'testdata/config12-flat' "$output") = 'same' ]]
}

@test "import config with -- in name" {
use_config config1
cp testdata/config-2 testdata/config--2
run ${COMMAND} import testdata/config--2
rm testdata/config--2
echo "$output"
[[ "$status" -eq 0 ]]
[[ $(check_fixture 'testdata/config12-flat' "$output") = 'same' ]]
}

@test "import multiple configs and print to stdout" {
use_config config1
run ${COMMAND} import testdata/config-2 testdata/config3
Expand Down Expand Up @@ -207,7 +217,7 @@ load common
[[ "$output" = *"error: contexts to export are missing"* ]]
}

@test "exporting without any context - I" {
@test "exporting without any context - II" {
run ${COMMAND} export
echo "$output"
[[ "$status" -eq 1 ]]
Expand Down

0 comments on commit 257274a

Please sign in to comment.