Skip to content

Commit

Permalink
force copy mode, ignoring git
Browse files Browse the repository at this point in the history
  • Loading branch information
lkingland committed Mar 21, 2024
1 parent f32c7ba commit 41b3da0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/builders/s2i/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func (b *Builder) Build(ctx context.Context, f fn.Function, platforms []fn.Platf
if _, err := os.Stat(s2iignorePath); err == nil {
fmt.Fprintln(os.Stderr, "Warning: an existing .s2iignore was detected. Using this with preferance over .funcignore")

Check failure on line 157 in pkg/builders/s2i/builder.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

[github.com/client9/misspell] reported by reviewdog 🐶 "preferance" is a misspelling of "preference" Raw Output: pkg/builders/s2i/builder.go:157:91: "preferance" is a misspelling of "preference"
} else {
os.Symlink("./.funcignore", filepath.Join(f.Root, ".s2iignore"))
defer os.Remove(filepath.Join(f.Root, ".s2iignore"))
os.Symlink("./.funcignore", s2iignorePath)

Check failure on line 159 in pkg/builders/s2i/builder.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

Error return value of `os.Symlink` is not checked (errcheck)
defer os.Remove(s2iignorePath)
}
}

Expand Down Expand Up @@ -451,7 +451,15 @@ func scaffold(cfg *api.Config, f fn.Function) (*api.Config, error) {
return nil, fmt.Errorf("unable to write go assembler. %w", err)
}
}
cfg.KeepSymlinks = true

cfg.KeepSymlinks = true // Don't infinite loop on the symlink to root.

// We want to force that the system use the (copy via filesystem)
// method rather than a "git clone" method because (other than being
// faster) appears to have a bug where the assemble script is ignored.
// Maybe this issue is related:
// https://github.com/openshift/source-to-image/issues/1141
cfg.ForceCopy = true

return cfg, nil
}

0 comments on commit 41b3da0

Please sign in to comment.