Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't break on --substitute values which have commas #580

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/stacker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ func main() {
&checkCmd,
}

app.DisableSliceFlagSeparator = true

app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "work-dir",
Expand Down
12 changes: 12 additions & 0 deletions test/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,15 @@ EOF
[ ! -f dest/rootfs/favicon.ico ]
[ ! -d dest/rootfs/stacker ]
}

@test "commas in substitute flags ok" {
cat > stacker.yaml <<EOF
busybox:
from:
type: oci
url: $BUSYBOX_OCI
run: |
touch /foo
EOF
stacker build --substitute "a=b,c"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this substitution used though in the stacker.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean in the testcase? It's not. That's not necessary to trigger the regression failure-to-build in main branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. When I run this test locally (sudo bats test/basic.bats), i get zero failures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the run: section, maybe echo "${{a}}"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I was wrong - I can reproduce this. No idea why.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failure is due to the gzip issue. It is a concern, but unrelated to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it seems to just be a flaky test? :

ubuntu@stacker:~/stacker$ sudo -E bats test/gzip.bats 
 ✓ import various sizes 

1 test, 0 failures

}
Loading