Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the ngn2 v1alpha1 API group +kubebuilder:object:generate=true +groupName=ngn2.nvidia.com
Index ¶
- Constants
- Variables
- func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
- func IsNotifyMaintenanceStatusInProgress(status MaintenanceStatus) bool
- type Annotation
- type MaintenanceCondition
- type MaintenanceStatus
- type MessageChannels
- type NotifyMaintenance
- func (in *NotifyMaintenance) DeepCopy() *NotifyMaintenance
- func (in *NotifyMaintenance) DeepCopyInto(out *NotifyMaintenance)
- func (in *NotifyMaintenance) DeepCopyObject() runtime.Object
- func (r *NotifyMaintenance) Default()
- func (nm NotifyMaintenance) GetNode() *k8sv1.Node
- func (nm NotifyMaintenance) IsInProgress() bool
- func (nm NotifyMaintenance) IsTerminal() bool
- func (r *NotifyMaintenance) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (nm NotifyMaintenance) String() string
- func (r *NotifyMaintenance) ValidateCreate() (err error)
- func (r *NotifyMaintenance) ValidateDelete() error
- func (r *NotifyMaintenance) ValidateNonDuplication() (err error)
- func (r *NotifyMaintenance) ValidateUpdate(old runtime.Object) (err error)
- type NotifyMaintenanceList
- type NotifyMaintenanceSpec
- type NotifyMaintenanceStatus
- func (in *NotifyMaintenanceStatus) DeepCopy() *NotifyMaintenanceStatus
- func (in *NotifyMaintenanceStatus) DeepCopyInto(out *NotifyMaintenanceStatus)
- func (nmStatus NotifyMaintenanceStatus) GetCondition(conditionType string) (MaintenanceCondition, bool)
- func (nmStatus NotifyMaintenanceStatus) IsSLAExpired() bool
- func (nmStatus *NotifyMaintenanceStatus) SetCondition(conditionType string, newStatus string)
- type StatusTransitionTimestamp
Constants ¶
const ( NotifyMaintenanceFinalState = "ngn2.nvidia.com/finalNotice" PodNMAnnotation = "ngn2.nvidia.com/notify" NMTerminalAnnotation = "maintenance.ngn2.nvidia.com/terminated" // MaintenanceClientAnnotation values. MaintenanceClientIncomplete = "incomplete" MaintenanceClientInprogress = "inprogress" MaintenanceClientComplete = "complete" // ValidationClientAnnotation values. ValidationClientInProgress = "inprogress" ValidationClientValidated = "validated" ValidationClientFailed = "failed" // Condition types. MaintenanceClientConditionType = "maintenanceClient" ValidationClientConditionType = "validationClient" ReadyForMaintenanceConditionType = "readyForMaintenance" PlannedMaintenance = "planned" UnplannedMaintenance = "unplanned" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: Group, Version: Version} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme // Used for tests. NotifyMaintenanceKind = "NotifyMaintenance" Group = "ngn2.nvidia.com" Version = "v1alpha1" )
var (
InProgressStatuses = []MaintenanceStatus{ObjectsDrained, MaintenanceStarted, SLAExpired, Validating}
)
var MaintenanceClientAnnotation = Annotation{ Key: utils.MAINTENANCE_LABEL_PREFIX + MaintenanceClientConditionType, ValidValues: []string{MaintenanceClientIncomplete, MaintenanceClientInprogress, MaintenanceClientComplete}, FinalStateValues: []string{MaintenanceClientIncomplete, MaintenanceClientComplete}, ConditionKey: MaintenanceClientConditionType, }
var ReadyForMaintenanceAnnotation = Annotation{ Key: utils.MAINTENANCE_LABEL_PREFIX + ReadyForMaintenanceConditionType, ValidValues: []string{"true", "false"}, FinalStateValues: []string{"true"}, ConditionKey: ReadyForMaintenanceConditionType, }
var ValidatedAnnotations = []Annotation{ MaintenanceClientAnnotation, ValidationClientAnnotation, ReadyForMaintenanceAnnotation, }
var ValidationClientAnnotation = Annotation{ Key: utils.MAINTENANCE_LABEL_PREFIX + ValidationClientConditionType, ValidValues: []string{ValidationClientInProgress, ValidationClientValidated, ValidationClientFailed}, FinalStateValues: []string{ValidationClientValidated, ValidationClientFailed}, ConditionKey: ValidationClientConditionType, }
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
func IsNotifyMaintenanceStatusInProgress ¶
func IsNotifyMaintenanceStatusInProgress(status MaintenanceStatus) bool
Types ¶
type Annotation ¶
type Annotation struct { Key string ValidValues []string FinalStateValues []string ConditionKey string }
func (*Annotation) DeepCopy ¶
func (in *Annotation) DeepCopy() *Annotation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Annotation.
func (*Annotation) DeepCopyInto ¶
func (in *Annotation) DeepCopyInto(out *Annotation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MaintenanceCondition ¶
type MaintenanceCondition struct { Type string `json:"type"` Status string `json:"status"` Reason string `json:"reason,omitempty"` Message string `json:"message,omitempty"` LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` }
MaintenanceCondition defines custom conditions.
func (*MaintenanceCondition) DeepCopy ¶
func (in *MaintenanceCondition) DeepCopy() *MaintenanceCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceCondition.
func (*MaintenanceCondition) DeepCopyInto ¶
func (in *MaintenanceCondition) DeepCopyInto(out *MaintenanceCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MaintenanceStatus ¶
type MaintenanceStatus string
const ( MaintenanceUnknown MaintenanceStatus = "" MaintenanceScheduled MaintenanceStatus = "MaintenanceScheduled" MaintenanceStarted MaintenanceStatus = "MaintenanceStarted" SLAExpired MaintenanceStatus = "SLAExpired" ObjectsDrained MaintenanceStatus = "ObjectsDrained" MaintenanceIncomplete MaintenanceStatus = "MaintenanceIncomplete" Validating MaintenanceStatus = "Validating" )
func GetInProgressMaintenanceStatuses ¶
func GetInProgressMaintenanceStatuses() []MaintenanceStatus
type MessageChannels ¶
type MessageChannels struct { // AmazonSNSTopicARN is the Amazon SNS topic that events for this object will be published to. AmazonSNSTopicARN string `json:"amazonSNSTopicARN,omitempty"` }
func (*MessageChannels) DeepCopy ¶
func (in *MessageChannels) DeepCopy() *MessageChannels
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageChannels.
func (*MessageChannels) DeepCopyInto ¶
func (in *MessageChannels) DeepCopyInto(out *MessageChannels)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NotifyMaintenance ¶
type NotifyMaintenance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec NotifyMaintenanceSpec `json:"spec,omitempty"` Status NotifyMaintenanceStatus `json:"status,omitempty"` }
+kubebuilder:object:root=true +kubebuilder:resource:singular=notifymaintenance +kubebuilder:subresource:status +kubebuilder:printcolumn:name="MaintenanceID",type="string",JSONPath=".spec.maintenanceID" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.maintenanceStatus" +kubebuilder:printcolumn:name="Node",type="string",JSONPath=".spec.nodeObject" +kubebuilder:printcolumn:name="SLAExpiry",type="string",JSONPath=`.status.slaExpires` +kubebuilder:printcolumn:name="ReadyForMaintenance",type="string",JSONPath=".status.conditions[?(@.type=='ObjectsDrained')].status" NotifyMaintenance is the Schema for the notifymaintenances API
func (*NotifyMaintenance) DeepCopy ¶
func (in *NotifyMaintenance) DeepCopy() *NotifyMaintenance
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifyMaintenance.
func (*NotifyMaintenance) DeepCopyInto ¶
func (in *NotifyMaintenance) DeepCopyInto(out *NotifyMaintenance)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NotifyMaintenance) DeepCopyObject ¶
func (in *NotifyMaintenance) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*NotifyMaintenance) Default ¶
func (r *NotifyMaintenance) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (NotifyMaintenance) GetNode ¶
func (nm NotifyMaintenance) GetNode() *k8sv1.Node
returns .spec.nodeObject as a k8sv1.Node object
func (NotifyMaintenance) IsInProgress ¶
func (nm NotifyMaintenance) IsInProgress() bool
func (NotifyMaintenance) IsTerminal ¶
func (nm NotifyMaintenance) IsTerminal() bool
func (*NotifyMaintenance) SetupWebhookWithManager ¶
func (r *NotifyMaintenance) SetupWebhookWithManager(mgr ctrl.Manager) error
func (NotifyMaintenance) String ¶
func (nm NotifyMaintenance) String() string
func (*NotifyMaintenance) ValidateCreate ¶
func (r *NotifyMaintenance) ValidateCreate() (err error)
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*NotifyMaintenance) ValidateDelete ¶
func (r *NotifyMaintenance) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (*NotifyMaintenance) ValidateNonDuplication ¶
func (r *NotifyMaintenance) ValidateNonDuplication() (err error)
func (*NotifyMaintenance) ValidateUpdate ¶
func (r *NotifyMaintenance) ValidateUpdate(old runtime.Object) (err error)
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
type NotifyMaintenanceList ¶
type NotifyMaintenanceList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []NotifyMaintenance `json:"items"` }
NotifyMaintenanceList contains a list of NotifyMaintenance.
func (*NotifyMaintenanceList) DeepCopy ¶
func (in *NotifyMaintenanceList) DeepCopy() *NotifyMaintenanceList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifyMaintenanceList.
func (*NotifyMaintenanceList) DeepCopyInto ¶
func (in *NotifyMaintenanceList) DeepCopyInto(out *NotifyMaintenanceList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NotifyMaintenanceList) DeepCopyObject ¶
func (in *NotifyMaintenanceList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type NotifyMaintenanceSpec ¶
type NotifyMaintenanceSpec struct { // Node object headed for Maintenance. NodeObject string `json:"nodeObject"` // MaintenanceID is a unique ID for a maintenance task. // +kubebuilder:validation:Pattern=`([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]` MaintenanceID string `json:"maintenanceID"` AdditionalMessageChannels MessageChannels `json:"additionalMessageChannels,omitempty"` // Planned or Unplanned Type string `json:"maintenanceType"` // Metadata for Maintenance Clients MetadataConfigmap string `json:"metadataConfigmap,omitempty"` // Owner (PIC) for Maintenance Owner string `json:"owner,omitempty"` }
NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. NotifyMaintenanceSpec defines the desired state of NotifyMaintenance.
func (*NotifyMaintenanceSpec) DeepCopy ¶
func (in *NotifyMaintenanceSpec) DeepCopy() *NotifyMaintenanceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifyMaintenanceSpec.
func (*NotifyMaintenanceSpec) DeepCopyInto ¶
func (in *NotifyMaintenanceSpec) DeepCopyInto(out *NotifyMaintenanceSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NotifyMaintenanceStatus ¶
type NotifyMaintenanceStatus struct { SLAExpires *metav1.Time `json:"slaExpires,omitempty"` MaintenanceStatus MaintenanceStatus `json:"maintenanceStatus,omitempty"` Conditions []MaintenanceCondition `json:"conditions,omitempty"` TransitionTimestamps []StatusTransitionTimestamp `json:"transitionTimestamps,omitempty"` }
NotifyMaintenanceStatus defines the observed state of NotifyMaintenance.
func (*NotifyMaintenanceStatus) DeepCopy ¶
func (in *NotifyMaintenanceStatus) DeepCopy() *NotifyMaintenanceStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifyMaintenanceStatus.
func (*NotifyMaintenanceStatus) DeepCopyInto ¶
func (in *NotifyMaintenanceStatus) DeepCopyInto(out *NotifyMaintenanceStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (NotifyMaintenanceStatus) GetCondition ¶
func (nmStatus NotifyMaintenanceStatus) GetCondition(conditionType string) (MaintenanceCondition, bool)
func (NotifyMaintenanceStatus) IsSLAExpired ¶
func (nmStatus NotifyMaintenanceStatus) IsSLAExpired() bool
func (*NotifyMaintenanceStatus) SetCondition ¶
func (nmStatus *NotifyMaintenanceStatus) SetCondition(conditionType string, newStatus string)
type StatusTransitionTimestamp ¶
type StatusTransitionTimestamp struct { MaintenanceStatus MaintenanceStatus `json:"maintenanceStatus,omitempty"` TransitionTimestamp metav1.Time `json:"transitionTimestamp,omitempty"` }
StatusTransitionTimestamp defines the timestamp when the transition to the specified MaintenanceStatus occurred.
func (*StatusTransitionTimestamp) DeepCopy ¶
func (in *StatusTransitionTimestamp) DeepCopy() *StatusTransitionTimestamp
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusTransitionTimestamp.
func (*StatusTransitionTimestamp) DeepCopyInto ¶
func (in *StatusTransitionTimestamp) DeepCopyInto(out *StatusTransitionTimestamp)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.