-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pivotal-cf:main' into main
- Loading branch information
Showing
17 changed files
with
502 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/pivotal-cf/kiln | ||
|
||
go 1.21 | ||
go 1.22.6 | ||
|
||
require ( | ||
github.com/Masterminds/semver/v3 v3.2.1 | ||
|
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
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,72 @@ | ||
package commands_test | ||
|
||
import ( | ||
"io" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"github.com/go-git/go-billy/v5" | ||
"github.com/go-git/go-billy/v5/memfs" | ||
|
||
"github.com/pivotal-cf/kiln/internal/commands" | ||
) | ||
|
||
var _ = Describe("validate", func() { | ||
var ( | ||
validate commands.Validate | ||
directory billy.Filesystem | ||
) | ||
|
||
BeforeEach(func() { | ||
directory = memfs.New() | ||
}) | ||
|
||
JustBeforeEach(func() { | ||
validate = commands.NewValidate(directory) | ||
}) | ||
|
||
When("the kilnfile has two release_sources", func() { | ||
BeforeEach(func() { | ||
f, err := directory.Create("Kilnfile") | ||
Expect(err).NotTo(HaveOccurred()) | ||
// language=yaml | ||
_, _ = io.WriteString(f, `--- | ||
release_sources: | ||
- type: "bosh.io" | ||
- type: "github" | ||
`) | ||
_ = f.Close() | ||
}) | ||
|
||
BeforeEach(func() { | ||
f, err := directory.Create("Kilnfile.lock") | ||
Expect(err).NotTo(HaveOccurred()) | ||
_ = f.Close() | ||
}) | ||
|
||
When("both types are in the allow list", func() { | ||
It("it does fail", func() { | ||
err := validate.Execute([]string{ | ||
"--allow-release-source-type=bosh.io", | ||
"--allow-release-source-type=github", | ||
}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
}) | ||
When("both one of the types is not in the allow list", func() { | ||
It("it does fail", func() { | ||
err := validate.Execute([]string{ | ||
"--allow-release-source-type=bosh.io", | ||
}) | ||
Expect(err).To(MatchError(ContainSubstring("release source type not allowed: github"))) | ||
}) | ||
}) | ||
When("the allow list is empty", func() { | ||
It("it does not fail", func() { | ||
err := validate.Execute([]string{}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.