v1alpha1

package
v0.0.0-...-3b2295e Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the app v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=app.ibm.com

Package v1alpha1 contains API Schema definitions for the app v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=app.ibm.com

Index

Constants

View Source
const (
	// DefaultRollingUpdateMaxUnavailablePercentage defines the percentage for rolling update
	DefaultRollingUpdateMaxUnavailablePercentage = 25
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "app.ibm.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
View Source
var (
	// AnnotationSyncSource target deployable to rolling update to
	AnnotationSyncSource = SchemeGroupVersion.Group + "/sync-source"
	// AnnotationRollingUpdateTarget target deployable to rolling update to
	AnnotationRollingUpdateTarget = SchemeGroupVersion.Group + "/rollingupdate-target"
	// AnnotationRollingUpdateMaxUnavailable defines max un available clusters during rolling update
	AnnotationRollingUpdateMaxUnavailable = SchemeGroupVersion.Group + "/rollingupdate-maxunavaialble"
	// AnnotationDeployables defines all deployables subscribed by the subscription
	AnnotationDeployables = SchemeGroupVersion.Group + "/deployables"
	// AnnotationHosting defines the subscription hosting the resource
	AnnotationHosting = SchemeGroupVersion.Group + "/hosting-subscription"
	// AnnotationChannelGeneration defines the channel generation
	AnnotationChannelGeneration = SchemeGroupVersion.Group + "/channel-generation"
)

Functions

Types

type HourRange

type HourRange struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

Time format for each time will be Kitchen format, defined at https://golang.org/pkg/time/#pkg-constants

func (*HourRange) DeepCopy

func (in *HourRange) DeepCopy() *HourRange

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

func (*HourRange) DeepCopyInto

func (in *HourRange) DeepCopyInto(out *HourRange)

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

type Overrides

type Overrides struct {
	PackageName string `json:"packageName"`
	// +kubebuilder:validation:MinItems=1
	PackageOverrides []PackageOverride `json:"packageOverrides"` // To be added
}

Overrides field in deployable

func (*Overrides) DeepCopy

func (in *Overrides) DeepCopy() *Overrides

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

func (*Overrides) DeepCopyInto

func (in *Overrides) DeepCopyInto(out *Overrides)

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

type PackageFilter

type PackageFilter struct {
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
	Annotations   map[string]string     `json:"annotations,omitempty"`
	// +kubebuilder:validation:Pattern=([0-9]+)((\.[0-9]+)(\.[0-9]+)|(\.[0-9]+)?(\.[xX]))$
	Version   string                       `json:"version,omitempty"`
	FilterRef *corev1.LocalObjectReference `json:"filterRef,omitempty"`
}

PackageFilter defines the reference to Channel

func (*PackageFilter) DeepCopy

func (in *PackageFilter) DeepCopy() *PackageFilter

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

func (*PackageFilter) DeepCopyInto

func (in *PackageFilter) DeepCopyInto(out *PackageFilter)

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

type PackageOverride

type PackageOverride struct {
	runtime.RawExtension `json:",inline"`
}

PackageOverride describes rules for override

func (*PackageOverride) DeepCopy

func (in *PackageOverride) DeepCopy() *PackageOverride

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

func (*PackageOverride) DeepCopyInto

func (in *PackageOverride) DeepCopyInto(out *PackageOverride)

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

type Subscriber

type Subscriber interface {
	SubscribeItem(*SubscriberItem) error
	UnsubscribeItem(types.NamespacedName) error
}

Subsriber defines common interface of different channel types

type SubscriberItem

type SubscriberItem struct {
	Subscription          *Subscription
	SubscriptionConfigMap *corev1.ConfigMap
	Channel               *chnv1alpha1.Channel
	ChannelSecret         *corev1.Secret
	ChannelConfigMap      *corev1.ConfigMap
}

+k8s:deepcopy-gen:nonpointer-interfaces=true SubsriberItem defines subscriber item to share subscribers with different channel types

func (*SubscriberItem) DeepCopy

func (in *SubscriberItem) DeepCopy() *SubscriberItem

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

func (*SubscriberItem) DeepCopyInto

func (in *SubscriberItem) DeepCopyInto(out *SubscriberItem)

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

type Subscription

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

	Spec   SubscriptionSpec   `json:"spec,omitempty"`
	Status SubscriptionStatus `json:"status,omitempty"`
}

Subscription is the Schema for the subscriptions API +k8s:openapi-gen=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase",description="subscription status" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:scope=Namespaced +kubebuilder:resource:shortName=appsub

func (*Subscription) DeepCopy

func (in *Subscription) DeepCopy() *Subscription

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

func (*Subscription) DeepCopyInto

func (in *Subscription) DeepCopyInto(out *Subscription)

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

func (*Subscription) DeepCopyObject

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

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

type SubscriptionClusterStatusMap

type SubscriptionClusterStatusMap map[string]*SubscriptionPerClusterStatus

SubscriptionClusterStatusMap defines per cluster status, key is cluster name

func (SubscriptionClusterStatusMap) DeepCopy

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

func (SubscriptionClusterStatusMap) DeepCopyInto

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

type SubscriptionList

type SubscriptionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Subscription `json:"items"`
}

SubscriptionList contains a list of Subscription

func (*SubscriptionList) DeepCopy

func (in *SubscriptionList) DeepCopy() *SubscriptionList

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

func (*SubscriptionList) DeepCopyInto

func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList)

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

func (*SubscriptionList) DeepCopyObject

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

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

type SubscriptionPerClusterStatus

type SubscriptionPerClusterStatus struct {
	SubscriptionPackageStatus map[string]*SubscriptionUnitStatus `json:"packages,omitempty"`
}

SubscriptionPerClusterStatus defines status for subscription in each cluster, key is package name

func (*SubscriptionPerClusterStatus) DeepCopy

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

func (*SubscriptionPerClusterStatus) DeepCopyInto

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

type SubscriptionPhase

type SubscriptionPhase string

SubscriptionPhase defines the phasing of a Subscription

const (
	// SubscriptionUnknown means this subscription is the "parent" sitting in hub
	SubscriptionUnknown SubscriptionPhase = ""
	// SubscriptionPropagated means this subscription is the "parent" sitting in hub
	SubscriptionPropagated SubscriptionPhase = "Propagated"
	// SubscriptionSubscribed means this subscription is child sitting in managed cluster
	SubscriptionSubscribed SubscriptionPhase = "Subscribed"
	// SubscriptionFailed means this subscription is the "parent" sitting in hub
	SubscriptionFailed SubscriptionPhase = "Failed"
)

type SubscriptionSpec

type SubscriptionSpec struct {
	Channel string `json:"channel"`
	// To specify 1 package in channel
	Package string `json:"name,omitempty"`
	// To specify more than 1 package in channel
	PackageFilter *PackageFilter `json:"packageFilter,omitempty"`
	// To provide flexibility to override package in channel with local input
	PackageOverrides []*Overrides `json:"packageOverrides,omitempty"`
	// For hub use only, to specify which clusters to go to
	Placement *plrv1alpha1.Placement `json:"placement,omitempty"`
	// for hub use only to specify the overrides when apply to clusters
	Overrides []dplv1alpha1.Overrides `json:"overrides,omitempty"`
	// help user control when the subscription will take affect
	TimeWindow *TimeWindow `json:"timewindow,omitempty"`
}

SubscriptionSpec defines the desired state of Subscription

func (*SubscriptionSpec) DeepCopy

func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec

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

func (*SubscriptionSpec) DeepCopyInto

func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec)

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

type SubscriptionStatus

type SubscriptionStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	Phase          SubscriptionPhase `json:"phase,omitempty"`
	Message        string            `json:"message,omitempty"`
	Reason         string            `json:"reason,omitempty"`
	LastUpdateTime metav1.Time       `json:"lastUpdateTime,omitempty"`

	// For endpoint, it is the status of subscription, key is packagename,
	// For hub, it aggregates all status, key is cluster name
	Statuses SubscriptionClusterStatusMap `json:"statuses,omitempty"`
}

SubscriptionStatus defines the observed state of Subscription Examples - status of a subscription on hub Status:

	phase: Propagated
	statuses:
	  washdc:
		packages:
		  nginx:
			phase: Subscribed
		  mongodb:
			phase: Failed
			Reason: "not authorized"
			Message: "user xxx does not have permission to start pod"
			resourceStatus: {}
   toronto:
		packages:
		  nginx:
			phase: Subscribed
		  mongodb:
			phase: Subscribed

Status of a subscription on managed cluster will only have 1 cluster in the map.

func (*SubscriptionStatus) DeepCopy

func (in *SubscriptionStatus) DeepCopy() *SubscriptionStatus

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

func (*SubscriptionStatus) DeepCopyInto

func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus)

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

type SubscriptionUnitStatus

type SubscriptionUnitStatus struct {
	// Phase are Propagated if it is in hub or Subscribed if it is in endpoint
	Phase          SubscriptionPhase `json:"phase,omitempty"`
	Message        string            `json:"message,omitempty"`
	Reason         string            `json:"reason,omitempty"`
	LastUpdateTime metav1.Time       `json:"lastUpdateTime"`

	ResourceStatus *runtime.RawExtension `json:"resourceStatus,omitempty"`
}

SubscriptionUnitStatus defines status of a unit (subscription or package)

func (*SubscriptionUnitStatus) DeepCopy

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

func (*SubscriptionUnitStatus) DeepCopyInto

func (in *SubscriptionUnitStatus) DeepCopyInto(out *SubscriptionUnitStatus)

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

type TimeWindow

type TimeWindow struct {
	// active time window or not, if timewindow is active, then deploy will only applies during these windows
	WindowType string `json:"windowtype,omitempty"`
	// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
	Location string `json:"location,omitempty"`
	// weekdays defined the day of the week for this time window https://golang.org/pkg/time/#Weekday
	Weekdays []string    `json:"weekdays,omitempty"`
	Hours    []HourRange `json:"hours,omitempty"`
}

TimeWindow defines a time window for subscription to run or be blocked

func (*TimeWindow) DeepCopy

func (in *TimeWindow) DeepCopy() *TimeWindow

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

func (*TimeWindow) DeepCopyInto

func (in *TimeWindow) DeepCopyInto(out *TimeWindow)

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

Jump to

Keyboard shortcuts

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