Skip to content

Commit

Permalink
Make Wolfi a part of Docker packaging
Browse files Browse the repository at this point in the history
* New images with `-wolfi` suffix get created
* Wolfi is used for preparing the file structure for Docker images
  • Loading branch information
rdner committed Aug 21, 2024
1 parent 5efae2b commit df355a7
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 178 deletions.
11 changes: 5 additions & 6 deletions dev-tools/packaging/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ func checkDockerEntryPoint(t *testing.T, p *packageFile, info *dockerInfo) {
})
}

// {BeatName}-{OptionalVariantSuffix}-oss-{version}-{os}-{arch}.docker.tar.gz
// For example, `heartbeat-oss-8.16.0-linux-arm64.docker.tar.gz`
var ossSuffixRegexp = regexp.MustCompile(`^(\w+)(-\w+)?-oss-.+$`)

func checkDockerLabels(t *testing.T, p *packageFile, info *dockerInfo, file string) {
vendor := info.Config.Labels["org.label-schema.vendor"]
if vendor != "Elastic" {
Expand All @@ -474,12 +478,7 @@ func checkDockerLabels(t *testing.T, p *packageFile, info *dockerInfo, file stri

t.Run(fmt.Sprintf("%s license labels", p.Name), func(t *testing.T) {
expectedLicense := "Elastic License"
ossPrefix := strings.Join([]string{
info.Config.Labels["org.label-schema.name"],
"oss",
info.Config.Labels["org.label-schema.version"],
}, "-")
if strings.HasPrefix(filepath.Base(file), ossPrefix) {
if ossSuffixRegexp.MatchString(filepath.Base(file)) {
expectedLicense = "ASL 2.0"
}
licenseLabels := []string{
Expand Down
Loading

0 comments on commit df355a7

Please sign in to comment.