Skip to content

Commit

Permalink
Revert "Exclude 386 for contrib (open-telemetry#83)" (open-telemetry#144
Browse files Browse the repository at this point in the history
)

This reverts commit fe8f761.
  • Loading branch information
mx-psi authored Jun 3, 2022
1 parent 0d0a2ff commit 8032c7b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
22 changes: 22 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ builds:
- linux
- windows
goarch:
- "386"
- amd64
- arm64
ignore:
Expand Down Expand Up @@ -162,6 +163,24 @@ dockers:
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-386
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/386
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: amd64
dockerfile: distributions/otelcol-contrib/Dockerfile
Expand Down Expand Up @@ -215,11 +234,14 @@ docker_manifests:
.Version }}-arm64
- name_template: otel/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- otel/opentelemetry-collector-contrib:{{ .Version }}-amd64
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm64
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
.Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{
Expand Down
15 changes: 4 additions & 11 deletions goreleaser/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@ import (

var (
ImagePrefixes = []string{"otel", "ghcr.io/open-telemetry/opentelemetry-collector-releases"}
Architectures = []string{"386", "amd64", "arm64"}

distsFlag = flag.String("d", "", "Collector distributions(s) to build, comma-separated")
)

func architecturesForDist(dist string) []string {
architectures := []string{"386", "amd64", "arm64"}
if dist == "otelcol-contrib" {
architectures = []string{"amd64", "arm64"}
}
return architectures
}

func main() {
flag.Parse()

Expand Down Expand Up @@ -84,7 +77,7 @@ func Build(dist string) config.Build {
Ldflags: []string{"-s", "-w"},
},
Goos: []string{"darwin", "linux", "windows"},
Goarch: architecturesForDist(dist),
Goarch: Architectures,
Ignore: []config.IgnoredBuild{
{Goos: "darwin", Goarch: "386"},
{Goos: "windows", Goarch: "arm64"},
Expand Down Expand Up @@ -157,7 +150,7 @@ func Package(dist string) config.NFPM {

func DockerImages(imagePrefixes, dists []string) (r []config.Docker) {
for _, dist := range dists {
for _, arch := range architecturesForDist(dist) {
for _, arch := range Architectures {
r = append(r, DockerImage(imagePrefixes, dist, arch))
}
}
Expand Down Expand Up @@ -211,7 +204,7 @@ func DockerManifests(imagePrefixes, dists []string) (r []config.DockerManifest)
func DockerManifest(imagePrefixes []string, dist string) (manifests []config.DockerManifest) {
for _, prefix := range imagePrefixes {
var imageTemplates []string
for _, arch := range architecturesForDist(dist) {
for _, arch := range Architectures {
imageTemplates = append(
imageTemplates,
fmt.Sprintf("%s/%s:{{ .Version }}-%s", prefix, imageName(dist), arch),
Expand Down

0 comments on commit 8032c7b

Please sign in to comment.