api

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultImageTag = "latest"

DefaultImageTag is used when an image tag is needed and the configuration does not specify a tag to use.

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 added in v0.4.3

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 JoinImageStreamTag added in v0.5.1

func JoinImageStreamTag(name, tag string) string

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 SplitImageStreamTag added in v0.5.1

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 UpdateTrackingTags added in v0.5.1

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

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.

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"`
}

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

type DockerFSLayer added in v0.4.2

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

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

type DockerHistory added in v0.4.2

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 {
	kapi.TypeMeta `json:",inline"`

	ID              string       `json:"Id"`
	Parent          string       `json:"Parent,omitempty"`
	Comment         string       `json:"Comment,omitempty"`
	Created         util.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 added in v0.4.2

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 added in v0.4.2

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

DockerImageReference points to a Docker image.

func DockerImageReferenceForStream added in v0.4.3

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

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

func ParseDockerImageReference added in v0.4.2

func ParseDockerImageReference(spec string) (DockerImageReference, error)

ParseDockerImageReference parses a Docker pull spec string into a DockerImageReference.

func (DockerImageReference) DockerClientDefaults added in v0.4.2

func (r DockerImageReference) DockerClientDefaults() DockerImageReference

DockerClientDefaults sets the default values used by the Docker client.

func (DockerImageReference) Minimal added in v0.4.3

Minimal reduces a DockerImageReference to its minimalist form.

func (DockerImageReference) String added in v0.4.2

func (r DockerImageReference) String() string

String converts a DockerImageReference to a Docker pull spec.

type DockerV1CompatibilityImage added in v0.4.2

type DockerV1CompatibilityImage struct {
	ID              string       `json:"id"`
	Parent          string       `json:"parent,omitempty"`
	Comment         string       `json:"comment,omitempty"`
	Created         util.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 {
	kapi.TypeMeta   `json:",inline"`
	kapi.ObjectMeta `json:"metadata,omitempty"`

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

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

func ImageWithMetadata added in v0.4.2

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 {
	kapi.TypeMeta `json:",inline"`
	kapi.ListMeta `json:"metadata,omitempty"`

	Items []Image `json:"items"`
}

ImageList is a list of Image objects.

func (*ImageList) IsAnAPIObject

func (*ImageList) IsAnAPIObject()

type ImageRepository

type ImageRepository struct {
	kapi.TypeMeta   `json:",inline"`
	kapi.ObjectMeta `json:"metadata,omitempty"`

	// Optional, if specified this repository is backed by a Docker repository on this server
	DockerImageRepository string `json:"dockerImageRepository,omitempty"`
	// Tags map arbitrary string values to specific image locators
	Tags map[string]string `json:"tags,omitempty"`

	// Status describes the current state of this repository
	Status ImageRepositoryStatus `json:"status,omitempty"`
}

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

ImageRepository is DEPRECATED; use ImageStream instead.

func (*ImageRepository) IsAnAPIObject

func (*ImageRepository) IsAnAPIObject()

type ImageRepositoryList

type ImageRepositoryList struct {
	kapi.TypeMeta `json:",inline"`
	kapi.ListMeta `json:"metadata,omitempty"`

	Items []ImageRepository `json:"items"`
}

ImageRepositoryList is a list of ImageRepository objects.

ImageRepositoryList is DEPRECATED; use ImageStreamList instead.

func (*ImageRepositoryList) IsAnAPIObject

func (*ImageRepositoryList) IsAnAPIObject()

type ImageRepositoryMapping

type ImageRepositoryMapping struct {
	kapi.TypeMeta   `json:",inline"`
	kapi.ObjectMeta `json:"metadata,omitempty"`

	// The Docker image repository the specified image is located in
	DockerImageRepository string `json:"dockerImageRepository"`
	// A Docker image.
	Image Image `json:"image"`
	// A string value this image can be located with inside the repository.
	Tag string `json:"tag"`
}

ImageRepositoryMapping 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.

ImageRepositoryMapping is DEPRECATED; use ImageStreamMapping instead.

func (*ImageRepositoryMapping) IsAnAPIObject

func (*ImageRepositoryMapping) IsAnAPIObject()

type ImageRepositoryStatus

type ImageRepositoryStatus struct {
	// Represents the effective location this repository may be accessed at. May be empty until the server
	// determines where the repository is located
	DockerImageRepository string `json:"dockerImageRepository,omitempty"`
	// 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 `json:"tags,omitempty"`
}

ImageRepositoryStatus contains information about the state of this image repository.

ImageRepositoryStatus is DEPRECATED; use ImageStreamStatus instead.

type ImageRepositoryTag added in v0.4.2

type ImageRepositoryTag struct {
	Image `json:",inline"`
}

ImageRepositoryTag exists to allow calls to `osc get imageRepositoryTag ...` to function.

ImageRepositoryTag is DEPRECATED; use ImageStreamTag instead.

type ImageStream added in v0.4.3

type ImageStream struct {
	kapi.TypeMeta   `json:",inline"`
	kapi.ObjectMeta `json:"metadata,omitempty"`

	// Spec describes the desired state of this stream
	Spec ImageStreamSpec `json:"spec"`
	// Status describes the current state of this stream
	Status ImageStreamStatus `json:"status,omitempty"`
}

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 added in v0.4.3

func (*ImageStream) IsAnAPIObject()

type ImageStreamImage added in v0.4.2

type ImageStreamImage struct {
	Image `json:",inline"`
}

ImageStreamImage exists to allow calls to `osc get imageStreamImage ...` to function.

type ImageStreamList added in v0.4.3

type ImageStreamList struct {
	kapi.TypeMeta `json:",inline"`
	kapi.ListMeta `json:"metadata,omitempty"`

	Items []ImageStream `json:"items"`
}

ImageStreamList is a list of ImageStream objects.

func (*ImageStreamList) IsAnAPIObject added in v0.4.3

func (*ImageStreamList) IsAnAPIObject()

type ImageStreamMapping added in v0.4.3

type ImageStreamMapping struct {
	kapi.TypeMeta   `json:",inline"`
	kapi.ObjectMeta `json:"metadata,omitempty"`

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

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 added in v0.4.3

func (*ImageStreamMapping) IsAnAPIObject()

type ImageStreamSpec added in v0.4.3

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

ImageStreamSpec represents options for ImageStreams.

type ImageStreamStatus added in v0.4.3

type ImageStreamStatus struct {
	// Represents the effective location this stream may be accessed at. May be empty until the server
	// determines where the repository is located
	DockerImageRepository string `json:"dockerImageRepository,omitempty"`
	// 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 `json:"tags,omitempty"`
}

ImageStreamStatus contains information about the state of this image stream.

type ImageStreamTag added in v0.4.3

type ImageStreamTag struct {
	Image     `json:",inline"`
	ImageName string
}

ImageStreamTag exists to allow calls to `osc get imageStreamTag ...` to function.

func (*ImageStreamTag) IsAnAPIObject added in v0.4.3

func (*ImageStreamTag) IsAnAPIObject()

type TagEvent added in v0.4.2

type TagEvent struct {
	// When the TagEvent was created
	Created util.Time `json:"created"`
	// The string that can be used to pull this image
	DockerImageReference string `json:"dockerImageReference"`
	// The image
	Image string `json:"image"`
}

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

func LatestTaggedImage added in v0.4.2

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 added in v0.4.2

type TagEventList struct {
	Items []TagEvent `json:"items"`
}

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

type TagReference added in v0.4.3

type TagReference struct {
	Annotations          map[string]string     `json:"annotations,omitempty"`
	DockerImageReference string                `json:"dockerImageReference,omitempty"`
	From                 *kapi.ObjectReference `json:"from,omitempty"`
}

TagReference allows a user to TODO.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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