v1beta1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme. It's to allow
	// code to compile without explicitly referencing generated types. You should
	// declare one in each package that will have generated deep copy or conversion
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var (
	// MaxImportAttempts holds how many times we gonna try to import an ImageImport object
	// before giving up.
	MaxImportAttempts = 10
	// MaxImageHReferences tells us how many image references a Image can hold on its status.
	MaxImageHReferences = 25
	// GroupVersion is a string that holds "group/version" for the resources of this package.
	GroupVersion = fmt.Sprintf("%s/%s", SchemeGroupVersion.Group, SchemeGroupVersion.Version)
	// ImageKind holds the kind we use when saving Images in the k8s API.
	ImageKind = "Image"
	// ImageImportKind holds the kind we use when saving ImageImports in the k8s API.
	ImageImportKind = "ImageImport"
	// ImageImportConsumedFlagAnnotation is the annotation set in an ImageImport object
	// whenever the temporary ImageImport object has already been consumed and is not
	// needed anymore.
	ImageImportConsumedFlagAnnotation = "images.shipwright.io/consumed"
	// ConditionTypeImported is a condition we report in ImageImport objects, presenting the
	// current Import status back to the user.
	ConditionTypeImported = "Imported"
	// ConditionReasonProgressing is used to indicate the ImageImport is progressing.
	ConditionReasonProgressing = "Progressing"
	// ConditionReasonImageImported is used to indicate an ImageImport attempt has been
	// executed sucessfully.
	ConditionReasonImageImported = "ImageImported"
	// ConditionReasonNoMoreAttempts is used when we can't proceed attempting to process an
	// ImageImport object.
	ConditionReasonNoMoreAttempts = "NoMoreAttempts"
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   "shipwright.io",
	Version: "v1beta1",
}

SchemeGroupVersion is the group/version for Image resources.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type HashReference

type HashReference struct {
	From           string      `json:"from"`
	ImportedAt     metav1.Time `json:"importedAt"`
	ImageReference string      `json:"imageReference,omitempty"`
}

HashReference is an reference to an imported Image (by its sha).

func (*HashReference) DeepCopy

func (in *HashReference) DeepCopy() *HashReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HashReference.

func (*HashReference) DeepCopyInto

func (in *HashReference) DeepCopyInto(out *HashReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Image

type Image struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ImageSpec   `json:"spec,omitempty"`
	Status ImageStatus `json:"status,omitempty"`
}

Image is a map between an internal kubernetes image tag and multiple remote hosted images.

func (*Image) CurrentReferenceForImage

func (t *Image) CurrentReferenceForImage() string

CurrentReferenceForImage looks through provided Image and returns the most recent imported reference found (first item in .status.HashReferences).

func (*Image) DeepCopy

func (in *Image) DeepCopy() *Image

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image.

func (*Image) DeepCopyInto

func (in *Image) DeepCopyInto(out *Image)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Image) DeepCopyObject

func (in *Image) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Image) PrependFinishedImport

func (t *Image) PrependFinishedImport(imp ImageImport)

PrependFinishedImport prepends provided ImageImport into Image status hash references, keeps MaxImageHReferences references. We do not prepend the provided ImageImport if the most recent import in the Image points to the same image.

func (*Image) PrependFinishedImports

func (t *Image) PrependFinishedImports(imps []ImageImport)

PrependFinishedImports calls PrependFinishedImport for each ImageImport in the slice.

func (*Image) Validate

func (t *Image) Validate() error

Validate checks Image contain all mandatory fields.

type ImageImport

type ImageImport struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ImageImportSpec   `json:"spec,omitempty"`
	Status ImageImportStatus `json:"status,omitempty"`
}

ImageImport represents a request, made by the user, to import a Image from a remote repository and into an Image object.

func (*ImageImport) AlreadyImported

func (t *ImageImport) AlreadyImported() bool

AlreadyImported checks if a given ImageImport has already been executed, we evaluate this by inspecting if we already have a HashReference for the image in its Status.

func (*ImageImport) DeepCopy

func (in *ImageImport) DeepCopy() *ImageImport

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageImport.

func (*ImageImport) DeepCopyInto

func (in *ImageImport) DeepCopyInto(out *ImageImport)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImageImport) DeepCopyObject

func (in *ImageImport) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ImageImport) FailedImportAttempts

func (t *ImageImport) FailedImportAttempts() int

FailedImportAttempts returns the number of failed import attempts.

func (*ImageImport) FlagAsConsumed

func (t *ImageImport) FlagAsConsumed()

FlagAsConsumed is used whenever we have already processed the data in an ImageImport object. This Annotation does not indicate anything at the k8s scope and it is solely used inside this operator. The value in the annotation is the current date and time encoded as time.ANSIC.

func (*ImageImport) FlaggedAsConsumed

func (t *ImageImport) FlaggedAsConsumed() bool

FlaggedAsConsumed returns if this ImageImport is flagged for deletion. Inspects the object's Annotations.

func (*ImageImport) FlaggedAsConsumedDuration

func (t *ImageImport) FlaggedAsConsumedDuration() (time.Duration, error)

FlaggedAsConsumedDuration returns the amount of time that has passed since the ImageImport was flagged for deletion.

func (*ImageImport) InheritValuesFrom

func (t *ImageImport) InheritValuesFrom(it *Image)

InheritValuesFrom uses provided Image to set default values for required propertis in a ImageImport before processing it. For example if no "From" has been specified in the ImageImport object we read it from the provided Image object. This function guarantees that there will be no nil pointers in the ImageImport spec property.

func (*ImageImport) OwnedByImage

func (t *ImageImport) OwnedByImage(img *Image) bool

OwnedByImage returns true if ImageImport is owned by provided Image.

func (*ImageImport) RegisterImportFailure

func (t *ImageImport) RegisterImportFailure(err error)

RegisterImportFailure updates the import attempts slice appending a new failed attempt with the provided error. This function also sets ImageImport.Status.Condition field.

func (*ImageImport) RegisterImportSuccess

func (t *ImageImport) RegisterImportSuccess()

RegisterImportSuccess appends a new ImportAttempt to the status registering it worked as expected. This function also sets ImageImport.Status.Condition field.

func (*ImageImport) SetOwnerImage

func (t *ImageImport) SetOwnerImage(img *Image)

SetOwnerImage makes sure that provided ImageImport has provided Image among its owners.

func (*ImageImport) Validate

func (t *ImageImport) Validate() error

Validate checks ImageImport contain all mandatory fields.

type ImageImportList

type ImageImportList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

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

ImageImportList is a list of ImageImport objects.

func (*ImageImportList) DeepCopy

func (in *ImageImportList) DeepCopy() *ImageImportList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageImportList.

func (*ImageImportList) DeepCopyInto

func (in *ImageImportList) DeepCopyInto(out *ImageImportList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImageImportList) DeepCopyObject

func (in *ImageImportList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ImageImportSpec

type ImageImportSpec struct {
	TargetImage string `json:"targetImage"`
	From        string `json:"from"`
	Mirror      *bool  `json:"mirror,omitempty"`
	Insecure    *bool  `json:"insecure,omitempty"`
}

ImageImportSpec represents the body of the request to import a given container image tag from a remote location. Values not set in here are read from the TargetImage, e.g. if no "mirror" is set here but it is set in the targetImage we use it.

func (*ImageImportSpec) DeepCopy

func (in *ImageImportSpec) DeepCopy() *ImageImportSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageImportSpec.

func (*ImageImportSpec) DeepCopyInto

func (in *ImageImportSpec) DeepCopyInto(out *ImageImportSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageImportStatus

type ImageImportStatus struct {
	Condition      metav1.Condition `json:"condition"`
	ImportAttempts []ImportAttempt  `json:"importAttempts"`
	HashReference  *HashReference   `json:"hashReference,omitempty"`
}

ImageImportStatus holds the current status for an image tag import attempt.

func (*ImageImportStatus) DeepCopy

func (in *ImageImportStatus) DeepCopy() *ImageImportStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageImportStatus.

func (*ImageImportStatus) DeepCopyInto

func (in *ImageImportStatus) DeepCopyInto(out *ImageImportStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageList

type ImageList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

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

ImageList is a list of Image.

func (*ImageList) DeepCopy

func (in *ImageList) DeepCopy() *ImageList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageList.

func (*ImageList) DeepCopyInto

func (in *ImageList) DeepCopyInto(out *ImageList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImageList) DeepCopyObject

func (in *ImageList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ImageSpec

type ImageSpec struct {
	From     string `json:"from"`
	Mirror   bool   `json:"mirror"`
	Insecure bool   `json:"insecure"`
}

ImageSpec represents the user intention with regards to importing remote images.

func (*ImageSpec) DeepCopy

func (in *ImageSpec) DeepCopy() *ImageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec.

func (*ImageSpec) DeepCopyInto

func (in *ImageSpec) DeepCopyInto(out *ImageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageStatus

type ImageStatus struct {
	HashReferences []HashReference `json:"hashReferences,omitempty"`
}

ImageStatus is the current status for an Image.

func (*ImageStatus) DeepCopy

func (in *ImageStatus) DeepCopy() *ImageStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageStatus.

func (*ImageStatus) DeepCopyInto

func (in *ImageStatus) DeepCopyInto(out *ImageStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImportAttempt

type ImportAttempt struct {
	When    metav1.Time `json:"when"`
	Succeed bool        `json:"succeed"`
	Reason  string      `json:"reason,omitempty"`
}

ImportAttempt holds data about an import cycle. Keeps track if it was successful, when it happened and if not successful what was the error reported (reason).

func (*ImportAttempt) DeepCopy

func (in *ImportAttempt) DeepCopy() *ImportAttempt

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportAttempt.

func (*ImportAttempt) DeepCopyInto

func (in *ImportAttempt) DeepCopyInto(out *ImportAttempt)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis
gen
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/images/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/images/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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