From 11186132285bc3e8dedc9f3b0ec83b34b2e6b7c6 Mon Sep 17 00:00:00 2001 From: Ilya Lesikov Date: Wed, 2 Nov 2022 12:12:23 +0300 Subject: [PATCH] fix(buildah): broken build on mac/win Signed-off-by: Ilya Lesikov --- pkg/buildah/common.go | 2 +- pkg/buildah/thirdparty/healthcheck_linux.go | 2 +- pkg/buildah/thirdparty/healthcheck_others.go | 2 +- pkg/container_backend/buildah_backend.go | 6 +++--- pkg/container_backend/instruction/healthcheck.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/buildah/common.go b/pkg/buildah/common.go index 977b5a085b..555923e4c3 100644 --- a/pkg/buildah/common.go +++ b/pkg/buildah/common.go @@ -101,7 +101,7 @@ type ConfigOpts struct { EntrypointPrependShell bool User string Workdir string - Healthcheck *thirdparty.HealthConfig + Healthcheck *thirdparty.BuildahHealthConfig OnBuild string StopSignal string Shell []string diff --git a/pkg/buildah/thirdparty/healthcheck_linux.go b/pkg/buildah/thirdparty/healthcheck_linux.go index 02ef0c9f60..241f3dee62 100644 --- a/pkg/buildah/thirdparty/healthcheck_linux.go +++ b/pkg/buildah/thirdparty/healthcheck_linux.go @@ -5,4 +5,4 @@ package thirdparty import "github.com/containers/buildah/docker" -type HealthConfig docker.HealthConfig +type BuildahHealthConfig docker.HealthConfig diff --git a/pkg/buildah/thirdparty/healthcheck_others.go b/pkg/buildah/thirdparty/healthcheck_others.go index 0ec3413265..a1d48ecbf9 100644 --- a/pkg/buildah/thirdparty/healthcheck_others.go +++ b/pkg/buildah/thirdparty/healthcheck_others.go @@ -6,7 +6,7 @@ package thirdparty import "time" // Copied from github.com/containers/buildah@v1.26.1/docker/types.go:52 -type HealthConfig struct { +type BuildahHealthConfig struct { Test []string `json:",omitempty"` Interval time.Duration `json:",omitempty"` Timeout time.Duration `json:",omitempty"` diff --git a/pkg/container_backend/buildah_backend.go b/pkg/container_backend/buildah_backend.go index 47d8d261e2..3592891857 100644 --- a/pkg/container_backend/buildah_backend.go +++ b/pkg/container_backend/buildah_backend.go @@ -905,8 +905,8 @@ func getGIDFromGroupName(group, etcGroupPath string) (uint32, error) { return 0, fmt.Errorf("could not find GID for group %q in passwd file %q", group, etcGroupPath) } -// Can return nil pointer to HealthConfig -func newHealthConfigFromString(healthcheck string) (*thirdparty.HealthConfig, error) { +// Can return nil pointer to BuildahHealthConfig +func newHealthConfigFromString(healthcheck string) (*thirdparty.BuildahHealthConfig, error) { if healthcheck == "" { return nil, nil } @@ -932,7 +932,7 @@ func newHealthConfigFromString(healthcheck string) (*thirdparty.HealthConfig, er } healthcheckcmd := cmd.(*instructions.HealthCheckCommand) - healthconfig := (*thirdparty.HealthConfig)(healthcheckcmd.Health) + healthconfig := (*thirdparty.BuildahHealthConfig)(healthcheckcmd.Health) return healthconfig, nil } diff --git a/pkg/container_backend/instruction/healthcheck.go b/pkg/container_backend/instruction/healthcheck.go index 588daddd1b..2db8f6b96b 100644 --- a/pkg/container_backend/instruction/healthcheck.go +++ b/pkg/container_backend/instruction/healthcheck.go @@ -26,7 +26,7 @@ func (i *Healthcheck) UsesBuildContext() bool { func (i *Healthcheck) Apply(ctx context.Context, containerName string, drv buildah.Buildah, drvOpts buildah.CommonOpts, buildContextArchive container_backend.BuildContextArchiver) error { if err := drv.Config(ctx, containerName, buildah.ConfigOpts{ CommonOpts: drvOpts, - Healthcheck: (*thirdparty.HealthConfig)(i.Health), + Healthcheck: (*thirdparty.BuildahHealthConfig)(i.Health), }); err != nil { return fmt.Errorf("error setting healthcheck for container %s: %w", containerName, err) }