MCPcopy Create free account
hub / github.com/conforma/cli / hashFile

Function hashFile

acceptance/kubernetes/kind/image.go:204–215  ·  view source on GitHub ↗

hashFile adds the contents of a file to the given hash, prefixed by its path for domain separation.

(h io.Writer, path string)

Source from the content-addressed store, hash-verified

202// hashFile adds the contents of a file to the given hash, prefixed by its path
203// for domain separation.
204func hashFile(h io.Writer, path string) error {
205 fmt.Fprintf(h, "file:%s\n", path)
206
207 f, err := os.Open(path)
208 if err != nil {
209 return err
210 }
211 defer f.Close()
212
213 _, err = io.Copy(h, f)
214 return err
215}
216
217// buildTaskBundleImage runs `make task-bundle` for each version of the Task in
218// the `$REPOSITORY_ROOT/task` directory to push the Tekton Task bundle to the

Callers 1

computeSourceHashFunction · 0.85

Calls 2

CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected