Skip to content

Commit

Permalink
Merge branch 'main' into fix/delete-ephemeral-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
natalieparellano authored Sep 11, 2024
2 parents 620ee48 + df70f4c commit 97c9422
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/buildpack/buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ id = "bp.one"
version = "1.2.3"
homepage = "http://geocities.com/cool-bp"
sbom-formats = ["this should not warn"]
clear-env = true
[[targets]]
os = "some-os"
Expand Down
4 changes: 2 additions & 2 deletions pkg/cache/cache_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (c *CacheOpts) Set(value string) error {
return errors.Errorf("invalid field '%s' must be a key=value pair", field)
}
key := strings.ToLower(parts[0])
value := strings.ToLower(parts[1])
value := parts[1]
if key == "type" {
switch value {
case "build":
Expand All @@ -86,7 +86,7 @@ func (c *CacheOpts) Set(value string) error {
return errors.Errorf("invalid field '%s' must be a key=value pair", field)
}
key := strings.ToLower(parts[0])
value := strings.ToLower(parts[1])
value := parts[1]
switch key {
case "format":
switch value {
Expand Down
21 changes: 21 additions & 0 deletions pkg/cache/cache_opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ func testCacheOpts(t *testing.T, when spec.G, it spec.S) {
input: fmt.Sprintf("type=launch;format=bind;source=%s/test-bind-volume-cache", homeDir),
output: fmt.Sprintf("type=build;format=volume;type=launch;format=bind;source=%s/test-bind-volume-cache/launch-cache;", homeDir),
},
{
name: "Case sensitivity test with uppercase path",
input: fmt.Sprintf("type=build;format=bind;source=%s/TestBindBuildCache", homeDir),
output: fmt.Sprintf("type=build;format=bind;source=%s/TestBindBuildCache/build-cache;type=launch;format=volume;", homeDir),
},
{
name: "Case sensitivity test with mixed case path",
input: fmt.Sprintf("type=build;format=bind;source=%s/TeStBiNdBuildCaChe", homeDir),
output: fmt.Sprintf("type=build;format=bind;source=%s/TeStBiNdBuildCaChe/build-cache;type=launch;format=volume;", homeDir),
},
}
} else {
testcases = []CacheOptTestCase{
Expand All @@ -253,6 +263,17 @@ func testCacheOpts(t *testing.T, when spec.G, it spec.S) {
input: fmt.Sprintf("type=launch;format=bind;source=%s\\test-bind-volume-cache", homeDir),
output: fmt.Sprintf("type=build;format=volume;type=launch;format=bind;source=%s\\test-bind-volume-cache\\launch-cache;", homeDir),
},
// Case sensitivity test cases for Windows
{
name: "Case sensitivity test with uppercase path",
input: fmt.Sprintf("type=build;format=bind;source=%s\\TestBindBuildCache", homeDir),
output: fmt.Sprintf("type=build;format=bind;source=%s\\TestBindBuildCache\\build-cache;type=launch;format=volume;", homeDir),
},
{
name: "Case sensitivity test with mixed case path",
input: fmt.Sprintf("type=build;format=bind;source=%s\\TeStBiNdBuildCaChe", homeDir),
output: fmt.Sprintf("type=build;format=bind;source=%s\\TeStBiNdBuildCaChe\\build-cache;type=launch;format=volume;", homeDir),
},
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/dist/buildmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ModuleInfo struct {
Homepage string `toml:"homepage,omitempty" json:"homepage,omitempty" yaml:"homepage,omitempty"`
Keywords []string `toml:"keywords,omitempty" json:"keywords,omitempty" yaml:"keywords,omitempty"`
Licenses []License `toml:"licenses,omitempty" json:"licenses,omitempty" yaml:"licenses,omitempty"`
ClearEnv bool `toml:"clear-env,omitempty" json:"clear-env,omitempty" yaml:"clear-env,omitempty"`
}

func (b ModuleInfo) FullName() string {
Expand Down

0 comments on commit 97c9422

Please sign in to comment.