v1

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1 defines all of the versioned (v1) definitions of the Smith model. +groupName=smith.atlassian.com

Index

Constants

View Source
const (
	BundleReasonTerminalError  = "TerminalError"
	BundleReasonRetriableError = "RetriableError"
)
View Source
const (
	BundleResourceSingular = "bundle"
	BundleResourcePlural   = "bundles"
	BundleResourceVersion  = "v1"
	BundleResourceKind     = "Bundle"

	BundleResourceGroupVersion = GroupName + "/" + BundleResourceVersion

	BundleResourceName = BundleResourcePlural + "." + GroupName
)
View Source
const GroupName = smith.Domain

GroupName is the group name use in this package.

Variables

View Source
var (
	// SchemeBuilder needs to be exported as `SchemeBuilder` so
	// the code-generation can find it.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is exposed for API installation
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects.

Functions

func DeepCopy_v1_Bundle

func DeepCopy_v1_Bundle(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_Bundle is an autogenerated deepcopy function.

func DeepCopy_v1_BundleCondition

func DeepCopy_v1_BundleCondition(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_BundleCondition is an autogenerated deepcopy function.

func DeepCopy_v1_BundleList

func DeepCopy_v1_BundleList(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_BundleList is an autogenerated deepcopy function.

func DeepCopy_v1_BundleSpec

func DeepCopy_v1_BundleSpec(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_BundleSpec is an autogenerated deepcopy function.

func DeepCopy_v1_BundleStatus

func DeepCopy_v1_BundleStatus(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_BundleStatus is an autogenerated deepcopy function.

func DeepCopy_v1_Resource

func DeepCopy_v1_Resource(in interface{}, out interface{}, c *conversion.Cloner) error

DeepCopy_v1_Resource is an autogenerated deepcopy function.

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind.

func RegisterDeepCopies

func RegisterDeepCopies(scheme *runtime.Scheme) error

RegisterDeepCopies adds deep-copy functions to the given scheme. Public to allow building arbitrary schemes.

Types

type Bundle

type Bundle struct {
	meta_v1.TypeMeta `json:",inline"`

	// Standard object metadata
	meta_v1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the specification of the desired behavior of the Bundle.
	Spec BundleSpec `json:"spec,omitempty"`

	// Status is most recently observed status of the Bundle.
	Status BundleStatus `json:"status,omitempty"`
}

Bundle describes a resources bundle.

func (*Bundle) GetCondition

func (b *Bundle) GetCondition(conditionType BundleConditionType) (int, *BundleCondition)

func (*Bundle) UpdateCondition

func (b *Bundle) UpdateCondition(condition *BundleCondition) bool

Updates existing Bundle condition or creates a new one. Sets LastTransitionTime to now if the status has changed. Returns true if Bundle condition has changed or has been added.

type BundleCondition

type BundleCondition struct {
	// Type of Bundle condition.
	Type BundleConditionType `json:"type"`
	// Status of the condition.
	Status ConditionStatus `json:"status"`
	// The last time this condition was updated.
	LastUpdateTime meta_v1.Time `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime meta_v1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

BundleCondition describes the state of a bundle at a certain point.

type BundleConditionType

type BundleConditionType string
const (
	BundleInProgress BundleConditionType = "InProgress"
	BundleReady      BundleConditionType = "Ready"
	BundleError      BundleConditionType = "Error"
)

These are valid conditions of a Bundle.

type BundleList

type BundleList struct {
	meta_v1.TypeMeta `json:",inline"`
	// Standard list metadata.
	meta_v1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of bundles.
	Items []Bundle `json:"items"`
}

type BundleSpec

type BundleSpec struct {
	Resources []Resource `json:"resources"`
}

type BundleStatus

type BundleStatus struct {
	// Represents the latest available observations of a Bundle's current state.
	Conditions []BundleCondition `json:"conditions,omitempty"`
}

func (*BundleStatus) ShortString

func (bs *BundleStatus) ShortString() string

type ConditionStatus

type ConditionStatus string
const (
	ConditionTrue    ConditionStatus = "True"
	ConditionFalse   ConditionStatus = "False"
	ConditionUnknown ConditionStatus = "Unknown"
)

These are valid condition statuses. "ConditionTrue" means a resource is in the condition. "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes can't decide if a resource is in the condition or not. In the future, we could add other intermediate conditions, e.g. ConditionDegraded.

type Resource

type Resource struct {
	// Name of the resource for references.
	Name ResourceName `json:"name"`

	// Explicit dependencies.
	DependsOn []ResourceName `json:"dependsOn,omitempty"`

	Spec runtime.Object `json:"spec"`
}

func (*Resource) IntoTyped

func (r *Resource) IntoTyped(obj runtime.Object) error

IntoTyped tries to convert resource spec into a typed object passed as obj. It supports objects of the same type and Unstructured. Note that it does not perform a deep copy in case of typed API object. Note that this method may fail if references are used where a non-string value is expected.

func (*Resource) ToUnstructured

func (r *Resource) ToUnstructured(copy smith.DeepCopy) (*unstructured.Unstructured, error)

ToUnstructured returns Spec field as an Unstructured object. It makes a copy if it is an Unstructured already.

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

type ResourceName

type ResourceName string

ResourceName is a reference to another Resource in the same bundle.

Jump to

Keyboard shortcuts

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