Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetName = func(i string) (string, error) { ref, err := name.ParseReference(i) if err != nil { return "", fmt.Errorf("error parsing image %s: %v", i, err) } if ref.Context().RegistryStr() == name.DefaultRegistry { suffix := strings.SplitN(ref.Name(), i, 2)[1] return i + suffix, nil } return ref.Name(), nil }
GetName returns the fullname of the image
View Source
var GetNameSlug = func(i string) (string, error) { name, err := GetName(i) if err != nil { return "", err } return util.Slugify(name), nil }
GetNameSlug returns the slugified fullname of the image
View Source
var GetNamesFromTarball = func(path string) ([]string, error) { opener := func() (io.ReadCloser, error) { return os.Open(path) } manifest, err := tarball.LoadManifest(opener) if err != nil { return nil, fmt.Errorf("error loading manifest from tarball: %v", err) } var repoTags []string for _, descriptor := range manifest { if len(descriptor.RepoTags) > 0 { repoTags = append(repoTags, descriptor.RepoTags...) } } if len(repoTags) == 0 { logrus.Debugf("No repository tags found in manifest of %s", path) return nil, nil } return repoTags, nil }
GetNamesFromTarball is a helper function to get the image names from a tarball
View Source
var Load = load
Load loads the image from a tarball.
Functions ¶
Types ¶
type GetConf ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.