v1

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 10 Imported by: 14

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 = ""
	// ChannelCertificateData is the configmap data spec field containing trust certificates
	ChannelCertificateData = "caCerts"
)

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 currently deployed Git repo commit ID
	AnnotationGitCommit = SchemeGroupVersion.Group + "/git-current-commit"
	// AnnotationGitCloneDepth defines Git repo clone depth to be able to check out previous commits
	AnnotationGitCloneDepth = SchemeGroupVersion.Group + "/git-clone-depth"
	// AnnotationGitTargetCommit defines Git repo commit to be deployed
	AnnotationGitTargetCommit = SchemeGroupVersion.Group + "/git-desired-commit"
	// AnnotationGitTag defines Git repo revision tag
	AnnotationGitTag = SchemeGroupVersion.Group + "/git-tag"
	// 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"
	// AnnotationResourceReconcileLevel is for resource reconciliation frequency
	AnnotationResourceReconcileLevel = SchemeGroupVersion.Group + "/reconcile-rate"
	// AnnotationManualReconcileTime is the time user triggers a manual resource reconcile
	AnnotationManualReconcileTime = SchemeGroupVersion.Group + "/manual-refresh-time"
	//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"
	// AnnotationBucketPath defines s3 object bucket subfolder path
	AnnotationBucketPath = SchemeGroupVersion.Group + "/bucket-path"
	// AnnotationManagedCluster identifies this is a deployable for managed cluster
	AnnotationManagedCluster = SchemeGroupVersion.Group + "/managed-cluster"
	// AnnotationHostingDeployable sits in templated resource, gives name of hosting deployable, legacy annotation
	AnnotationHostingDeployable = SchemeGroupVersion.Group + "/hosting-deployable"
)

Functions

Types

type AllowDenyItem added in v0.5.0

type AllowDenyItem struct {
	APIVersion string   `json:"apiVersion,omitempty"`
	Kinds      []string `json:"kinds,omitempty"`
}

AllowDenyItem is a group resources allowed or denied for deployment

func (*AllowDenyItem) DeepCopy added in v0.5.0

func (in *AllowDenyItem) DeepCopy() *AllowDenyItem

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

func (*AllowDenyItem) DeepCopyInto added in v0.5.0

func (in *AllowDenyItem) DeepCopyInto(out *AllowDenyItem)

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

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

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

ClusterOverride describes rules for override

func (*ClusterOverride) DeepCopy added in v0.5.0

func (in *ClusterOverride) DeepCopy() *ClusterOverride

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

func (*ClusterOverride) DeepCopyInto added in v0.5.0

func (in *ClusterOverride) DeepCopyInto(out *ClusterOverride)

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

type ClusterOverrides added in v0.5.0

type ClusterOverrides struct {
	ClusterName string `json:"clusterName"`
	//+kubebuilder:validation:MinItems=1
	ClusterOverrides []ClusterOverride `json:"clusterOverrides"` // To be added
}

Overrides field in deployable

func (*ClusterOverrides) DeepCopy added in v0.5.0

func (in *ClusterOverrides) DeepCopy() *ClusterOverrides

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

func (*ClusterOverrides) DeepCopyInto added in v0.5.0

func (in *ClusterOverrides) DeepCopyInto(out *ClusterOverrides)

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
	SecondaryChannel          *chnv1alpha1.Channel
	SecondaryChannelSecret    *corev1.Secret
	SecondaryChannelConfigMap *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"`
	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"`
	// When fails to connect to the channel, connect to the secondary channel
	SecondaryChannel string `json:"secondaryChannel"`
	// 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 []ClusterOverrides `json:"overrides,omitempty"`
	// help user control when the subscription will take affect
	TimeWindow *TimeWindow `json:"timewindow,omitempty"`
	// +optional
	HookSecretRef *corev1.ObjectReference `json:"hooksecretref,omitempty"`
	Allow         []*AllowDenyItem        `json:"allow,omitempty"`
	Deny          []*AllowDenyItem        `json:"deny,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