utils

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func ConvertKVStringsToMapWithNil added in v0.2.3

func ConvertKVStringsToMapWithNil(values []string) map[string]*string

ConvertKVStringsToMapWithNil converts ["key=value"] to {"key":"value"} but set unset keys to nil - meaning the ones with no "=" in them. We use this in cases where we need to distinguish between

FOO=  and FOO

where the latter case just means FOO was mentioned but not given a value Credit to: https://github.com/docker/cli/blob/ebca1413117a3fcb81c89d6be226dcec74e5289f/opts/parse.go#L60

func ExtractBaseImages

func ExtractBaseImages(input io.Reader) ([]string, error)

func HomeDir

func HomeDir() string

func ReadDockerIgnore

func ReadDockerIgnore(contextDir string) ([]string, error)

ReadDockerIgnore reads a .dockerignore file in `contextDir` and returns the list of file patterns to ignore. Note this will trim whitespace from each line as well as use GO's "clean" func to get the shortest/cleanest path for each. Excerpt from https://github.com/docker/docker/blob/master/builder/dockerignore/dockerignore.go

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL