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 +k8s:deepcopy-gen=package,register +groupName=apps.open-cluster-management.io
Index ¶
- Constants
- Variables
- func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
- type HourRange
- type Overrides
- type PackageFilter
- type PackageOverride
- type Subscriber
- type SubscriberItem
- type Subscription
- type SubscriptionClusterStatusMap
- type SubscriptionList
- type SubscriptionPerClusterStatus
- type SubscriptionPhase
- type SubscriptionSpec
- type SubscriptionStatus
- type SubscriptionUnitStatus
- type TimeWindow
Constants ¶
const (
DefaultRollingUpdateMaxUnavailablePercentage = 25
)
Variables ¶
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} )
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 = 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" // 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" //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" )
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
Types ¶
type HourRange ¶
HourRange time format for each time will be Kitchen format, defined at https://golang.org/pkg/time/#pkg-constants
func (*HourRange) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HourRange.
func (*HourRange) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overrides.
func (*Overrides) DeepCopyInto ¶
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
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: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 ¶
func (in SubscriptionClusterStatusMap) DeepCopy() SubscriptionClusterStatusMap
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionClusterStatusMap.
func (SubscriptionClusterStatusMap) DeepCopyInto ¶
func (in SubscriptionClusterStatusMap) DeepCopyInto(out *SubscriptionClusterStatusMap)
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 ¶
func (in *SubscriptionPerClusterStatus) DeepCopy() *SubscriptionPerClusterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionPerClusterStatus.
func (*SubscriptionPerClusterStatus) DeepCopyInto ¶
func (in *SubscriptionPerClusterStatus) DeepCopyInto(out *SubscriptionPerClusterStatus)
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 ¶
func (in *SubscriptionUnitStatus) DeepCopy() *SubscriptionUnitStatus
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.