From 774806edff17eb73fdf3b29e0427817773b413aa Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:14:08 +0000 Subject: [PATCH] Rename Wolfi images to satisfy the release naming convention (#40886) (#40902) For example, `filebeat-wolfi-oss` -> `filebeat-oss-wolfi` (cherry picked from commit 029e05696c3b665ad3ab48332d0c8df9f1b8ff1e) Co-authored-by: Denis --- dev-tools/packaging/package_test.go | 4 +- dev-tools/packaging/packages.yml | 176 ++++++++++++++-------------- 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/dev-tools/packaging/package_test.go b/dev-tools/packaging/package_test.go index a15a72cd097..cad23aec9e8 100644 --- a/dev-tools/packaging/package_test.go +++ b/dev-tools/packaging/package_test.go @@ -466,9 +466,9 @@ func checkDockerEntryPoint(t *testing.T, p *packageFile, info *dockerInfo) { }) } -// {BeatName}-{OptionalVariantSuffix}-oss-{version}-{os}-{arch}.docker.tar.gz +// {BeatName}-oss-{OptionalVariantSuffix}-{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-.+$`) +var ossSuffixRegexp = regexp.MustCompile(`^(\w+)-oss-.+$`) func checkDockerLabels(t *testing.T, p *packageFile, info *dockerInfo, file string) { vendor := info.Config.Labels["org.label-schema.vendor"] diff --git a/dev-tools/packaging/packages.yml b/dev-tools/packaging/packages.yml index 7db59f77559..8c22acc9dba 100644 --- a/dev-tools/packaging/packages.yml +++ b/dev-tools/packaging/packages.yml @@ -5,20 +5,20 @@ shared: - &common - name: "{{.BeatName}}" - service_name: "{{.BeatServiceName}}" - os: "{{.GOOS}}" - arch: "{{.PackageArch}}" - vendor: "{{.BeatVendor}}" - version: "{{ beat_version }}" - license: "{{.BeatLicense}}" - url: "{{.BeatURL}}" - description: "{{.BeatDescription}}" + name: '{{.BeatName}}' + service_name: '{{.BeatServiceName}}' + os: '{{.GOOS}}' + arch: '{{.PackageArch}}' + vendor: '{{.BeatVendor}}' + version: '{{ beat_version }}' + license: '{{.BeatLicense}}' + url: '{{.BeatURL}}' + description: '{{.BeatDescription}}' # Deb/RPM spec for community beats. - &deb_rpm_spec <<: *common - post_install_script: "{{ elastic_beats_dir }}/dev-tools/packaging/files/linux/systemd-daemon-reload.sh" + post_install_script: '{{ elastic_beats_dir }}/dev-tools/packaging/files/linux/systemd-daemon-reload.sh' files: /usr/share/{{.BeatName}}/bin/{{.BeatName}}{{.BinaryExt}}: source: build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} @@ -27,23 +27,23 @@ shared: source: fields.yml mode: 0644 /usr/share/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/LICENSE.txt" + source: '{{ repo.RootDir }}/LICENSE.txt' mode: 0644 /usr/share/{{.BeatName}}/NOTICE.txt: - source: "{{ repo.RootDir }}/NOTICE.txt" + source: '{{ repo.RootDir }}/NOTICE.txt' mode: 0644 /usr/share/{{.BeatName}}/README.md: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl' mode: 0644 /usr/share/{{.BeatName}}/.build_hash.txt: content: > {{ commit }} mode: 0644 /etc/{{.BeatName}}/{{.BeatName}}.reference.yml: - source: "{{.BeatName}}.reference.yml" + source: '{{.BeatName}}.reference.yml' mode: 0644 /etc/{{.BeatName}}/{{.BeatName}}.yml: - source: "{{.BeatName}}.yml" + source: '{{.BeatName}}.yml' mode: 0600 config: true /usr/share/{{.BeatName}}/kibana: @@ -53,13 +53,13 @@ shared: source: build/golang-crossbuild/god-{{.GOOS}}-{{.Platform.Arch}} mode: 0755 /usr/bin/{{.BeatName}}: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/linux/beatname.sh.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/linux/beatname.sh.tmpl' mode: 0755 /lib/systemd/system/{{.BeatServiceName}}.service: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/linux/systemd.unit.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/linux/systemd.unit.tmpl' mode: 0644 /etc/init.d/{{.BeatServiceName}}: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/{{.PackageType}}/init.sh.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/{{.PackageType}}/init.sh.tmpl' mode: 0755 # MacOS pkg spec for community beats. @@ -69,29 +69,29 @@ shared: # OS X 10.8 Mountain Lion is the oldest supported by Go 1.10. # https://golang.org/doc/go1.10#ports min_supported_osx_version: 10.8 - identifier: "co.{{.BeatVendor | tolower}}.beats.{{.BeatName}}" + identifier: 'co.{{.BeatVendor | tolower}}.beats.{{.BeatName}}' install_path: /Library/Application Support - pre_install_script: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/preinstall.tmpl" - post_install_script: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/postinstall.tmpl" + pre_install_script: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/preinstall.tmpl' + post_install_script: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/postinstall.tmpl' files: /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/bin/{{.BeatName}}{{.BinaryExt}}: source: build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} mode: 0755 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/LICENSE.txt" + source: '{{ repo.RootDir }}/LICENSE.txt' mode: 0644 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/NOTICE.txt: - source: "{{ repo.RootDir }}/NOTICE.txt" + source: '{{ repo.RootDir }}/NOTICE.txt' mode: 0644 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/README.md: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl' mode: 0644 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/.build_hash.txt: content: > {{ commit }} mode: 0644 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/{{.identifier}}.plist: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/launchd-daemon.plist.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/launchd-daemon.plist.tmpl' mode: 0644 /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/kibana: source: _meta/kibana.generated @@ -100,38 +100,38 @@ shared: source: fields.yml mode: 0644 /etc/{{.BeatName}}/{{.BeatName}}.reference.yml: - source: "{{.BeatName}}.reference.yml" + source: '{{.BeatName}}.reference.yml' mode: 0644 /etc/{{.BeatName}}/{{.BeatName}}.yml: - source: "{{.BeatName}}.yml" + source: '{{.BeatName}}.yml' mode: 0600 config: true - &binary_files - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} mode: 0755 fields.yml: source: fields.yml mode: 0644 LICENSE.txt: - source: "{{ repo.RootDir }}/LICENSE.txt" + source: '{{ repo.RootDir }}/LICENSE.txt' mode: 0644 NOTICE.txt: - source: "{{ repo.RootDir }}/NOTICE.txt" + source: '{{ repo.RootDir }}/NOTICE.txt' mode: 0644 README.md: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl' mode: 0644 .build_hash.txt: content: > {{ commit }} mode: 0644 - "{{.BeatName}}.reference.yml": - source: "{{.BeatName}}.reference.yml" + '{{.BeatName}}.reference.yml': + source: '{{.BeatName}}.reference.yml' mode: 0644 - "{{.BeatName}}.yml": - source: "{{.BeatName}}.yml" + '{{.BeatName}}.yml': + source: '{{.BeatName}}.yml' mode: 0600 config: true kibana: @@ -150,101 +150,101 @@ shared: files: <<: *binary_files install-service-{{.BeatName}}.ps1: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/windows/install-service.ps1.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/windows/install-service.ps1.tmpl' mode: 0755 uninstall-service-{{.BeatName}}.ps1: - template: "{{ elastic_beats_dir }}/dev-tools/packaging/templates/windows/uninstall-service.ps1.tmpl" + template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/windows/uninstall-service.ps1.tmpl' mode: 0755 - &docker_spec <<: *binary_spec extra_vars: - from: "--platform=linux/amd64 ubuntu:20.04" - buildFrom: "--platform=linux/amd64 cgr.dev/chainguard/wolfi-base" - user: "{{ .BeatName }}" - linux_capabilities: "" + from: '--platform=linux/amd64 ubuntu:20.04' + buildFrom: '--platform=linux/amd64 cgr.dev/chainguard/wolfi-base' + user: '{{ .BeatName }}' + linux_capabilities: '' files: - "{{.BeatName}}.yml": - source: "{{.BeatName}}.docker.yml" + '{{.BeatName}}.yml': + source: '{{.BeatName}}.docker.yml' mode: 0600 config: true - &docker_arm_spec <<: *docker_spec extra_vars: - from: "--platform=linux/arm64 ubuntu:20.04" - buildFrom: "--platform=linux/arm64 cgr.dev/chainguard/wolfi-base" + from: '--platform=linux/arm64 ubuntu:20.04' + buildFrom: '--platform=linux/arm64 cgr.dev/chainguard/wolfi-base' - &docker_ubi_spec extra_vars: - image_name: "{{.BeatName}}-ubi" - from: "--platform=linux/amd64 docker.elastic.co/ubi9/ubi-minimal" + image_name: '{{.BeatName}}-ubi' + from: '--platform=linux/amd64 docker.elastic.co/ubi9/ubi-minimal' - &docker_arm_ubi_spec extra_vars: - image_name: "{{.BeatName}}-ubi" - from: "--platform=linux/arm64 docker.elastic.co/ubi9/ubi-minimal" + image_name: '{{.BeatName}}-ubi' + from: '--platform=linux/arm64 docker.elastic.co/ubi9/ubi-minimal' - &docker_wolfi_spec extra_vars: - image_name: "{{.BeatName}}-wolfi" - from: "--platform=linux/amd64 cgr.dev/chainguard/wolfi-base" + image_name: '{{.BeatName}}-wolfi' + from: '--platform=linux/amd64 cgr.dev/chainguard/wolfi-base' - &docker_arm_wolfi_spec extra_vars: - image_name: "{{.BeatName}}-wolfi" - from: "--platform=linux/arm64 cgr.dev/chainguard/wolfi-base" + image_name: '{{.BeatName}}-wolfi' + from: '--platform=linux/arm64 cgr.dev/chainguard/wolfi-base' - &elastic_docker_spec extra_vars: - repository: "docker.elastic.co/beats" + repository: 'docker.elastic.co/beats' # # License modifiers for Apache 2.0 # - &apache_license_for_binaries - license: "ASL 2.0" + license: 'ASL 2.0' files: LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt" + source: '{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt' mode: 0644 - &apache_license_for_deb_rpm - license: "ASL 2.0" + license: 'ASL 2.0' files: /usr/share/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt" + source: '{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt' mode: 0644 - &apache_license_for_macos_pkg - license: "ASL 2.0" + license: 'ASL 2.0' files: /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt" + source: '{{ repo.RootDir }}/licenses/APACHE-LICENSE-2.0.txt' mode: 0644 # # License modifiers for the Elastic License # - &elastic_license_for_binaries - license: "Elastic License" + license: 'Elastic License' files: LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt" + source: '{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt' mode: 0644 - &elastic_license_for_deb_rpm - license: "Elastic License" + license: 'Elastic License' files: /usr/share/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt" + source: '{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt' mode: 0644 - &elastic_license_for_macos_pkg - license: "Elastic License" + license: 'Elastic License' files: /Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/LICENSE.txt: - source: "{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt" + source: '{{ repo.RootDir }}/licenses/ELASTIC-LICENSE.txt' mode: 0644 # specs is a list of named packaging "flavors". @@ -296,28 +296,28 @@ specs: spec: <<: *windows_binary_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: darwin types: [tgz] spec: <<: *binary_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: linux types: [tgz] spec: <<: *binary_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: linux types: [deb, rpm] spec: <<: *deb_rpm_spec <<: *apache_license_for_deb_rpm - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: linux types: [docker] @@ -326,7 +326,7 @@ specs: <<: *docker_spec <<: *elastic_docker_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: linux types: [docker] @@ -336,9 +336,9 @@ specs: <<: *docker_wolfi_spec <<: *elastic_docker_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-wolfi-oss" + name: '{{.BeatName}}-oss-wolfi' extra_vars: - image_name: "{{.BeatName}}-wolfi-oss" + image_name: '{{.BeatName}}-oss-wolfi' - os: linux types: [docker] @@ -347,7 +347,7 @@ specs: <<: *docker_arm_spec <<: *elastic_docker_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' - os: linux types: [docker] @@ -357,16 +357,16 @@ specs: <<: *docker_arm_wolfi_spec <<: *elastic_docker_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-wolfi-oss" + name: '{{.BeatName}}-oss-wolfi' extra_vars: - image_name: "{{.BeatName}}-wolfi-oss" + image_name: '{{.BeatName}}-oss-wolfi' - os: aix types: [tgz] spec: <<: *binary_spec <<: *apache_license_for_binaries - name: "{{.BeatName}}-oss" + name: '{{.BeatName}}-oss' # Elastic Beat with Elastic License and binary taken the current directory. elastic_beat_xpack: @@ -495,7 +495,7 @@ specs: <<: *windows_binary_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: darwin @@ -504,7 +504,7 @@ specs: <<: *binary_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -513,7 +513,7 @@ specs: <<: *binary_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -533,7 +533,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -545,7 +545,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -557,7 +557,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -568,7 +568,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -580,7 +580,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -592,7 +592,7 @@ specs: <<: *elastic_docker_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: aix @@ -601,7 +601,7 @@ specs: <<: *binary_spec <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: ./{{.XPackDir}}/{{.BeatName}}/build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}} - os: linux @@ -619,7 +619,7 @@ specs: spec: <<: *elastic_license_for_binaries files: - "{{.BeatName}}{{.BinaryExt}}": + '{{.BeatName}}{{.BinaryExt}}': source: data/{{.BeatName}}-{{ commit_short }}/{{.BeatName}}{{.BinaryExt}} symlink: true mode: 0755