v1

package
v0.2.2-pre Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Overview

Package v1 contains API Schema definitions for the apps v1 API group +k8s:deepcopy-gen=package,register +groupName=apps.open-cluster-management.io

Package v1 contains API Schema definitions for the apps v1 API group +kubebuilder:object:generate=true +groupName=apps.open-cluster-management.io +versionName=v1

Index

Constants

View Source
const (
	// DefaultRollingUpdateMaxUnavailablePercentage defines the percentage for rolling update
	DefaultRollingUpdateMaxUnavailablePercentage = 25
	// SubscriptionAdmin is used as RBAC resource name for multi-namespace app deployment
	SubscriptionAdmin = "open-cluster-management:subscription-admin"
	// AcmWebhook is the ACM foundation mutation webhook that adds user identity and group annotations
	AcmWebhook = "ocm-mutating-webhook"
	// MergeReconcile creates or updates fields in resources using kubernetes patch
	MergeReconcile = "merge"
	// ReplaceReconcile replaces fields in resources using kubernetes update
	ReplaceReconcile = "replace"
	// SubscriptionNameSuffix is appended to the subscription name when propagated to managed clusters
	SubscriptionNameSuffix = ""
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "apps.open-cluster-management.io", Version: "v1"}

	// 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"
	// AnnotationTopo list all resources will create by the subscription
	AnnotationTopo = SchemeGroupVersion.Group + "/topo"
	// AnnotationHosting defines the subscription hosting the resource
	AnnotationHosting = SchemeGroupVersion.Group + "/hosting-subscription"
	// AnnotationChannelGeneration defines the channel generation
	AnnotationChannelGeneration = SchemeGroupVersion.Group + "/channel-generation"
	// AnnotationWebhookEnabled indicates webhook event notification is enabled
	AnnotationWebhookEnabled = SchemeGroupVersion.Group + "/webhook-enabled"
	// AnnotationWebhookEventCount gets incremented by an incoming webhook event notification
	AnnotationWebhookEventCount = SchemeGroupVersion.Group + "/webhook-event-count"
	// AnnotationWebhookSecret defines webhook secret
	AnnotationWebhookSecret = SchemeGroupVersion.Group + "/webhook-secret"
	// AnnotationGithubPath defines webhook secret
	AnnotationGithubPath = SchemeGroupVersion.Group + "/github-path"
	// AnnotationGithubBranch defines webhook secret
	AnnotationGithubBranch = SchemeGroupVersion.Group + "/github-branch"
	// AnnotationGithubCommit defines Git repo commit ID
	AnnotationGithubCommit = SchemeGroupVersion.Group + "/github-commit"
	// AnnotationGitPath defines webhook secret
	AnnotationGitPath = SchemeGroupVersion.Group + "/git-path"
	// AnnotationGitBranch defines webhook secret
	AnnotationGitBranch = SchemeGroupVersion.Group + "/git-branch"
	// AnnotationGitCommit defines Git repo commit ID
	AnnotationGitCommit = SchemeGroupVersion.Group + "/git-commit"
	// AnnotationClusterAdmin indicates the subscription has cluster admin access
	AnnotationClusterAdmin = SchemeGroupVersion.Group + "/cluster-admin"
	// AnnotationChannelType indicates the channel type for subscription
	AnnotationChannelType = SchemeGroupVersion.Group + "/channel-type"
	// AnnotationUserGroup is subscription user group
	AnnotationUserGroup = "open-cluster-management.io/user-group"
	// AnnotationUserIdentity is subscription user id
	AnnotationUserIdentity = "open-cluster-management.io/user-identity"
	// AnnotationResourceReconcileOption is for reconciling existing resource
	AnnotationResourceReconcileOption = SchemeGroupVersion.Group + "/reconcile-option"
	//LabelSubscriptionPause sits in subscription label to identify if the subscription is paused or not
	LabelSubscriptionPause = "subscription-pause"
	//LabelSubscriptionName is the subscription name
	LabelSubscriptionName = SchemeGroupVersion.Group + "/subscription"
	// AnnotationHookType defines ansible hook job type - prehook/posthook
	AnnotationHookType = SchemeGroupVersion.Group + "/hook-type"
)

Functions

Types

type AnsibleJobsStatus

type AnsibleJobsStatus struct {
	LastPrehookJob     string   `json:"lastprehookjob,omitempty"`
	PrehookJobsHistory []string `json:"prehookjobshistory,omitempty"`

	LastPosthookJob     string   `json:"lastposthookjob,omitempty"`
	PosthookJobsHistory []string `json:"posthookjobshistory,omitempty"`
}

func (*AnsibleJobsStatus) DeepCopy

func (in *AnsibleJobsStatus) DeepCopy() *AnsibleJobsStatus

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

func (*AnsibleJobsStatus) DeepCopyInto

func (in *AnsibleJobsStatus) DeepCopyInto(out *AnsibleJobsStatus)

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

type HourRange

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

HourRange 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 {
	PackageAlias     string            `json:"packageAlias,omitempty"`
	PackageName      string            `json:"packageName"`
	PackageOverrides []PackageOverride `json:"packageOverrides,omitempty"` // 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
}

Subscriber efines common interface of different channel types +kubebuilder:object:generate=false

type SubscriberItem

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

SubscriberItem 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:printcolumn:name="Local placement",type="boolean",JSONPath=".spec.placement.local" +kubebuilder:printcolumn:name="Time window",type="string",JSONPath=".spec.timewindow.windowtype" +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"
	// SubscriptionPropagationFailed means this subscription is the "parent" sitting in hub
	SubscriptionPropagationFailed SubscriptionPhase = "PropagationFailed"
)

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"`
	// +optional
	HookSecretRef *corev1.ObjectReference `json:"hooksecretref,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"`

	// +optional
	AnsibleJobsStatus AnsibleJobsStatus `json:"ansiblejobs,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
	// Note, if you want to generation crd with operator-sdk v0.10.0, then the following line should be:
	// <+kubebuilder:validation:Enum=active,blocked,Active,Blocked>
	// +kubebuilder:validation:Enum={active,blocked,Active,Blocked}
	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
	Daysofweek []string    `json:"daysofweek,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