api

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ManagedByOpenShiftAnnotation indicates that an image is managed by OpenShift's registry.
	ManagedByOpenShiftAnnotation = "openshift.io/image.managed"

	// DockerImageRepositoryCheckAnnotation indicates that OpenShift has
	// attempted to import tag and image information from an external Docker
	// image repository.
	DockerImageRepositoryCheckAnnotation = "openshift.io/image.dockerRepositoryCheck"

	// InsecureRepositoryAnnotation may be set true on an image stream to allow insecure access to pull content.
	InsecureRepositoryAnnotation = "openshift.io/image.insecureRepository"

	// DefaultImageTag is used when an image tag is needed and the configuration does not specify a tag to use.
	DefaultImageTag = "latest"
)
View Source
const DockerDefaultNamespace = "library"

DockerDefaultNamespace is the value for namespace when a single segment name is provided.

Variables

This section is empty.

Functions

func AddTagEventToImageStream

func AddTagEventToImageStream(stream *ImageStream, tag string, next TagEvent) bool

AddTagEventToImageStream attempts to update the given image stream with a tag event. It will collapse duplicate entries - returning true if a change was made or false if no change occurred.

func ImageStreamToSelectableFields added in v1.0.8

func ImageStreamToSelectableFields(ir *ImageStream) fields.Set

ImageStreamToSelectableFields returns a label set that represents the object.

func ImageToSelectableFields added in v1.0.8

func ImageToSelectableFields(image *Image) fields.Set

ImageToSelectableFields returns a label set that represents the object.

func JoinImageStreamTag

func JoinImageStreamTag(name, tag string) string

JoinImageStreamTag turns a name and tag into the name of an ImageStreamTag

func NormalizeImageStreamTag added in v1.0.8

func NormalizeImageStreamTag(name string) string

NormalizeImageStreamTag normalizes an image stream tag by defaulting to 'latest' if no tag has been specified.

func ResolveImageID

func ResolveImageID(stream *ImageStream, imageID string) sets.String

ResolveImageID returns a sets.String of all the image IDs in stream that start with imageID.

func ShortDockerImageID added in v1.0.7

func ShortDockerImageID(image *DockerImage, length int) string

ShortDockerImageID returns a short form of the provided DockerImage ID for display

func SortStatusTags added in v1.0.6

func SortStatusTags(tags map[string]TagEventList) []string

SortStatusTags sorts the status tags of an image stream based on the latest created

func SplitImageStreamTag

func SplitImageStreamTag(nameAndTag string) (name string, tag string, ok bool)

SplitImageStreamTag turns the name of an ImageStreamTag into Name and Tag. It returns false if the tag was not properly specified in the name.

func UpdateChangedTrackingTags added in v1.0.7

func UpdateChangedTrackingTags(new, old *ImageStream) int

UpdateChangedTrackingTags identifies any tags in the status that have changed and ensures any referenced tracking tags are also updated. It returns the number of updates applied.

func UpdateTrackingTags

func UpdateTrackingTags(stream *ImageStream, updatedTag string, updatedImage TagEvent) int

UpdateTrackingTags sets updatedImage as the most recent TagEvent for all tags in stream.spec.tags that have from.kind = "ImageStreamTag" and the tag in from.name = updatedTag. from.name may be either <tag> or <stream name>:<tag>. For now, only references to tags in the current stream are supported.

For example, if stream.spec.tags[latest].from.name = 2.0, whenever an image is pushed to this stream with the tag 2.0, status.tags[latest].items[0] will also be updated to point at the same image that was just pushed for 2.0.

Returns the number of tags changed.

Types

type DockerConfig

type DockerConfig struct {
	Hostname        string              `json:"Hostname,omitempty"`
	Domainname      string              `json:"Domainname,omitempty"`
	User            string              `json:"User,omitempty"`
	Memory          int64               `json:"Memory,omitempty"`
	MemorySwap      int64               `json:"MemorySwap,omitempty"`
	CPUShares       int64               `json:"CpuShares,omitempty"`
	CPUSet          string              `json:"Cpuset,omitempty"`
	AttachStdin     bool                `json:"AttachStdin,omitempty"`
	AttachStdout    bool                `json:"AttachStdout,omitempty"`
	AttachStderr    bool                `json:"AttachStderr,omitempty"`
	PortSpecs       []string            `json:"PortSpecs,omitempty"`
	ExposedPorts    map[string]struct{} `json:"ExposedPorts,omitempty"`
	Tty             bool                `json:"Tty,omitempty"`
	OpenStdin       bool                `json:"OpenStdin,omitempty"`
	StdinOnce       bool                `json:"StdinOnce,omitempty"`
	Env             []string            `json:"Env,omitempty"`
	Cmd             []string            `json:"Cmd,omitempty"`
	DNS             []string            `json:"Dns,omitempty"` // For Docker API v1.9 and below only
	Image           string              `json:"Image,omitempty"`
	Volumes         map[string]struct{} `json:"Volumes,omitempty"`
	VolumesFrom     string              `json:"VolumesFrom,omitempty"`
	WorkingDir      string              `json:"WorkingDir,omitempty"`
	Entrypoint      []string            `json:"Entrypoint,omitempty"`
	NetworkDisabled bool                `json:"NetworkDisabled,omitempty"`
	SecurityOpts    []string            `json:"SecurityOpts,omitempty"`
	OnBuild         []string            `json:"OnBuild,omitempty"`
	Labels          map[string]string   `json:"Labels,omitempty"`
}

DockerConfig is the list of configuration options used when creating a container.

type DockerFSLayer

type DockerFSLayer struct {
	// DockerBlobSum is the tarsum of the referenced filesystem image layer
	// TODO make this digest.Digest once docker/distribution is in Godeps
	DockerBlobSum string `json:"blobSum"`
}

DockerFSLayer is a container struct for BlobSums defined in an image manifest

type DockerHistory

type DockerHistory struct {
	// DockerV1Compatibility is the raw v1 compatibility information
	DockerV1Compatibility string `json:"v1Compatibility"`
}

DockerHistory stores unstructured v1 compatibility information

type DockerImage

type DockerImage struct {
	unversioned.TypeMeta `json:",inline"`

	ID              string           `json:"Id"`
	Parent          string           `json:"Parent,omitempty"`
	Comment         string           `json:"Comment,omitempty"`
	Created         unversioned.Time `json:"Created,omitempty"`
	Container       string           `json:"Container,omitempty"`
	ContainerConfig DockerConfig     `json:"ContainerConfig,omitempty"`
	DockerVersion   string           `json:"DockerVersion,omitempty"`
	Author          string           `json:"Author,omitempty"`
	Config          *DockerConfig    `json:"Config,omitempty"`
	Architecture    string           `json:"Architecture,omitempty"`
	Size            int64            `json:"Size,omitempty"`
}

DockerImage is the type representing a docker image and its various properties when retrieved from the Docker client API.

func (*DockerImage) IsAnAPIObject

func (*DockerImage) IsAnAPIObject()

type DockerImageManifest

type DockerImageManifest struct {
	SchemaVersion int             `json:"schemaVersion"`
	Name          string          `json:"name"`
	Tag           string          `json:"tag"`
	Architecture  string          `json:"architecture"`
	FSLayers      []DockerFSLayer `json:"fsLayers"`
	History       []DockerHistory `json:"history"`
}

DockerImageManifest represents the Docker v2 image format.

type DockerImageReference

type DockerImageReference struct {
	Registry  string
	Namespace string
	Name      string
	Tag       string
	ID        string
}

DockerImageReference points to a Docker image.

func DockerImageReferenceForStream

func DockerImageReferenceForStream(stream *ImageStream) (DockerImageReference, error)

DockerImageReferenceForStream returns a DockerImageReference that represents the ImageStream or false, if no valid reference exists.

func ParseDockerImageReference

func ParseDockerImageReference(spec string) (DockerImageReference, error)

ParseDockerImageReference parses a Docker pull spec string into a DockerImageReference.

func (DockerImageReference) AsRepository added in v1.0.7

func (r DockerImageReference) AsRepository() DockerImageReference

AsRepository returns the reference without tags or IDs.

func (DockerImageReference) DaemonMinimal added in v1.0.7

func (r DockerImageReference) DaemonMinimal() DockerImageReference

DaemonMinimal clears defaults that Docker assumes.

func (DockerImageReference) DockerClientDefaults

func (r DockerImageReference) DockerClientDefaults() DockerImageReference

DockerClientDefaults sets the default values used by the Docker client.

func (DockerImageReference) Exact added in v1.0.7

func (r DockerImageReference) Exact() string

Exact returns a string representation of the set fields on the DockerImageReference

func (DockerImageReference) Minimal

Minimal reduces a DockerImageReference to its minimalist form.

func (DockerImageReference) NameString added in v1.0.5

func (r DockerImageReference) NameString() string

NameString returns the name of the reference with its tag or ID.

func (DockerImageReference) String

func (r DockerImageReference) String() string

String converts a DockerImageReference to a Docker pull spec (which implies a default namespace according to V1 Docker registry rules). Use Exact() if you want no defaulting.

type DockerV1CompatibilityImage

type DockerV1CompatibilityImage struct {
	ID              string           `json:"id"`
	Parent          string           `json:"parent,omitempty"`
	Comment         string           `json:"comment,omitempty"`
	Created         unversioned.Time `json:"created"`
	Container       string           `json:"container,omitempty"`
	ContainerConfig DockerConfig     `json:"container_config,omitempty"`
	DockerVersion   string           `json:"docker_version,omitempty"`
	Author          string           `json:"author,omitempty"`
	Config          *DockerConfig    `json:"config,omitempty"`
	Architecture    string           `json:"architecture,omitempty"`
	Size            int64            `json:"size,omitempty"`
}

DockerV1CompatibilityImage represents the structured v1 compatibility information.

type Image

type Image struct {
	unversioned.TypeMeta
	kapi.ObjectMeta

	// The string that can be used to pull this image.
	DockerImageReference string
	// Metadata about this image
	DockerImageMetadata DockerImage
	// This attribute conveys the version of docker metadata the JSON should be stored in, which if empty defaults to "1.0"
	DockerImageMetadataVersion string
	// The raw JSON of the manifest
	DockerImageManifest string
}

Image is an immutable representation of a Docker image and metadata at a point in time.

func ImageWithMetadata

func ImageWithMetadata(image Image) (*Image, error)

ImageWithMetadata returns a copy of image with the DockerImageMetadata filled in from the raw DockerImageManifest data stored in the image.

func (*Image) IsAnAPIObject

func (*Image) IsAnAPIObject()

type ImageList

type ImageList struct {
	unversioned.TypeMeta
	unversioned.ListMeta

	Items []Image
}

ImageList is a list of Image objects.

func (*ImageList) IsAnAPIObject

func (*ImageList) IsAnAPIObject()

type ImageStream

type ImageStream struct {
	unversioned.TypeMeta
	kapi.ObjectMeta

	// Spec describes the desired state of this stream
	Spec ImageStreamSpec
	// Status describes the current state of this stream
	Status ImageStreamStatus
}

ImageStream stores a mapping of tags to images, metadata overrides that are applied when images are tagged in a stream, and an optional reference to a Docker image repository on a registry.

func (*ImageStream) IsAnAPIObject

func (*ImageStream) IsAnAPIObject()

type ImageStreamImage

type ImageStreamImage struct {
	unversioned.TypeMeta
	kapi.ObjectMeta

	// The Image associated with the ImageStream and image name.
	Image Image
}

ImageStreamImage represents an Image that is retrieved by image name from an ImageStream.

func (*ImageStreamImage) IsAnAPIObject

func (*ImageStreamImage) IsAnAPIObject()

type ImageStreamList

type ImageStreamList struct {
	unversioned.TypeMeta
	unversioned.ListMeta

	Items []ImageStream
}

ImageStreamList is a list of ImageStream objects.

func (*ImageStreamList) IsAnAPIObject

func (*ImageStreamList) IsAnAPIObject()

type ImageStreamMapping

type ImageStreamMapping struct {
	unversioned.TypeMeta
	kapi.ObjectMeta

	// The Docker image repository the specified image is located in
	// DEPRECATED: remove once v1beta1 support is dropped
	DockerImageRepository string
	// A Docker image.
	Image Image
	// A string value this image can be located with inside the repository.
	Tag string
}

ImageStreamMapping represents a mapping from a single tag to a Docker image as well as the reference to the Docker image repository the image came from.

func (*ImageStreamMapping) IsAnAPIObject

func (*ImageStreamMapping) IsAnAPIObject()

type ImageStreamSpec

type ImageStreamSpec struct {
	// Optional, if specified this stream is backed by a Docker repository on this server
	DockerImageRepository string
	// Tags map arbitrary string values to specific image locators
	Tags map[string]TagReference
}

ImageStreamSpec represents options for ImageStreams.

type ImageStreamStatus

type ImageStreamStatus struct {
	// DockerImageRepository represents the effective location this stream may be accessed at. May be empty until the server
	// determines where the repository is located
	DockerImageRepository string
	// A historical record of images associated with each tag. The first entry in the TagEvent array is
	// the currently tagged image.
	Tags map[string]TagEventList
}

ImageStreamStatus contains information about the state of this image stream.

type ImageStreamTag

type ImageStreamTag struct {
	unversioned.TypeMeta
	kapi.ObjectMeta

	// The Image associated with the ImageStream and tag.
	Image Image
}

ImageStreamTag has a .Name in the format <stream name>:<tag>.

func (*ImageStreamTag) IsAnAPIObject

func (*ImageStreamTag) IsAnAPIObject()

type ImageStreamTagList added in v1.0.8

type ImageStreamTagList struct {
	unversioned.TypeMeta
	unversioned.ListMeta

	Items []ImageStreamTag
}

ImageStreamTagList is a list of ImageStreamTag objects.

func (*ImageStreamTagList) IsAnAPIObject added in v1.0.8

func (*ImageStreamTagList) IsAnAPIObject()

type TagEvent

type TagEvent struct {
	// When the TagEvent was created
	Created unversioned.Time
	// The string that can be used to pull this image
	DockerImageReference string
	// The image
	Image string
}

TagEvent is used by ImageRepositoryStatus to keep a historical record of images associated with a tag.

func LatestTaggedImage

func LatestTaggedImage(stream *ImageStream, tag string) *TagEvent

LatestTaggedImage returns the most recent TagEvent for the specified image repository and tag. Will resolve lookups for the empty tag. Returns nil if tag isn't present in stream.status.tags.

type TagEventList

type TagEventList struct {
	Items []TagEvent
}

TagEventList contains a historical record of images associated with a tag.

type TagReference

type TagReference struct {
	// Optional; if specified, annotations that are applied to images retrieved via ImageStreamTags.
	Annotations map[string]string
	// Optional; if specified, a reference to another image that this tag should point to. Valid values are ImageStreamTag, ImageStreamImage, and DockerImage.
	From *kapi.ObjectReference
	// Reference states if the tag will be imported. Default value is false, which means the tag will be imported.
	Reference bool
}

TagReference specifies optional annotations for images using this tag and an optional reference to an ImageStreamTag, ImageStreamImage, or DockerImage this tag should track.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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