Skip to content
Permalink
Browse files
fix(buildah): broken build on mac/win
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov committed Nov 2, 2022
1 parent c0de754 commit 11186132285bc3e8dedc9f3b0ec83b34b2e6b7c6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
@@ -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
@@ -5,4 +5,4 @@ package thirdparty

import "github.com/containers/buildah/docker"

type HealthConfig docker.HealthConfig
type BuildahHealthConfig docker.HealthConfig
@@ -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"`
@@ -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
}
@@ -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)
}

0 comments on commit 1118613

Please sign in to comment.