Documentation ¶
Index ¶
- Constants
- func DeepCopy(src, dest interface{}) error
- func GetActionMsg(action string) string
- func GetCategoryMsg(category string) string
- func GetKindMsg(kind string) string
- func GetPlural(kind string) string
- func GetSingular(kind string) string
- func SearchKind(keyword string) string
- type ApiObject
- type ApiObjectAction
- type ApiObjectList
- type BaseApiObj
- type BaseObj
- func (o BaseObj) GetMetadata() Metadata
- func (o *BaseObj) GetStatus() Status
- func (o BaseObj) GetStatusPhase() string
- func (o *BaseObj) Init()
- func (o *BaseObj) RaiseVersion()
- func (o *BaseObj) ResetConditions()
- func (o *BaseObj) SetCreateTime(time time.Time)
- func (o *BaseObj) SetMetadata(m Metadata)
- func (o *BaseObj) SetName(name string)
- func (o *BaseObj) SetNamespace(namespace string)
- func (o *BaseObj) SetStatus(status Status)
- func (o *BaseObj) SetStatusPhase(phase string)
- func (o *BaseObj) SetUpdateTime(time time.Time)
- type BaseRuntimeObj
- type Condition
- type ConditionResetter
- type ConfigMapKeyRef
- type Conversion
- type ConvertByBytesFunc
- type ConvertFunc
- type GK
- type GVK
- type JSONMarshaler
- type MetaType
- type MetaTypeGetter
- type Metadata
- type MetadataGetter
- type MetadataSetter
- type NewByGVKFunc
- type OpOpt
- type Option
- type RuntimeObject
- type SortByCreateTime
- type SortByRevision
- type SpecHasher
- type Status
- type VK
- type ValueFrom
- type Versioner
- type YAMLMarshaler
Constants ¶
View Source
const ( AnnotationPrefix = "pcitech.io/" AnnotationJobPrefix = AnnotationPrefix + "job/" AnnotationAlgorithmPluginPrefix = AnnotationPrefix + "algorithm-plugin/" AnnotationLastAppliedConfiguration = AnnotationPrefix + "last-applied-configuration" Group = "core" ApiVersionV1 = "v1" AppCategoryCustomize = "customize" AppCategoryThirdParty = "thirdParty" AppCategoryHostPlugin = "hostPlugin" AppCategoryAlgorithmPlugin = "algorithmPlugin" AppPlatformBareMetal = "bareMetal" AppPlatformK8s = "k8s" AppActionInstall = "install" AppActionConfigure = "configure" AppActionHealthcheck = "healthcheck" AppActionUninstall = "uninstall" AppActionUpdate = "update" AppActionUpgrade = "upgrade" AppActionRevert = "revert" AuditActionCreate = "create" AuditActionUpdate = "update" AuditActionDelete = "delete" DefaultEtcdEndpoint = "localhost:2379" DefaultNamespace = "default" RegistryPrefix = "/prophet" KindApp = "app" KindAppInstance = "appInstance" KindAudit = "audit" KindEvent = "event" KindHost = "host" KindJob = "job" KindConfigMap = "configMap" KindK8sConfig = "k8sconfig" KindK8sLabel = "k8slabel" KindNamespace = "namespace" KindPkg = "pkg" KindGPU = "gpu" KindProject = "project" KindRevision = "revision" ConditionTypeConnected = "Connected" ConditionTypeInitialized = "Initialized" ConditionTypeInstalled = "Installed" ConditionTypeHealthy = "Healthy" ConditionTypeReady = "Ready" ConditionTypeConfigured = "Configured" ConditionTypeRun = "Run" ConditionStatusTrue = "True" ConditionStatusFalse = "False" EventActionInstall = "Install" EventActionConfigure = "Configure" EventActionUninstall = "Uninstall" EventActionHealthCheck = "HealthCheck" EventActionUpgrade = "Upgrade" EventActionRevert = "Revert" EventActionLabel = "Label" EventActionUnLabel = "UnLabel" EventActionConnect = "Connect" EventActionInitial = "Initial" EventActionUninstallNode = "UninstallNode" EventActionInstallNode = "InstallNode" FinalizerCleanRefJob = "CleanRefJob" FinalizerCleanJobWorkDir = "CleanJobWorkDir" FinalizerCleanRefGPU = "CleanRefGPU" FinalizerReleaseRefGPU = "ReleaseRefGPU" FinalizerCleanRefEvent = "CleanRefEvent" FinalizerCleanRefConfigMap = "CleanRefConfigMap" FinalizerCleanRevision = "CleanRevision" FinalizerCleanHostPlugin = "CleanHostPlugin" JobExecTypeAnsible = "ansible" JobDefaultFailureThreshold = 1 JobDefaultTimeoutSeconds = 3600 PhaseRunning = "Running" PhaseInitialing = "Initialing" PhaseInstalling = "Installing" PhaseUninstalling = "Uninstalling" PhaseWaiting = "Waiting" PhaseFailed = "Failed" PhaseDeleting = "Deleting" PhaseBound = "Bound" PhaseCompleted = "Completed" PhaseConfiguring = "Configuring" PhaseUpgrading = "Upgrading" PhaseReverting = "Reverting" PhaseConnecting = "Connecting" PhaseCrashing = "Crashing" PhaseReady = "Ready" PhaseNotReady = "NotReady" PhaseInstalled = "Installed" PhaseUninstalled = "Uninstalled" PhaseLabel = "Label" PhaseUnLabel = "UnLabel" PhaseUninstallNode = "UninstallNode" PhaseInCompleted = "InstallCompleted" PhaseUnCompleted = "UninstallCompleted" PkgProvisionFull = "full" PkgProvisionThin = "thin" ValidNameRegex = `^[a-zA-Z0-9_\-\.]{1,256}$` )
Variables ¶
This section is empty.
Functions ¶
func DeepCopy ¶
func DeepCopy(src, dest interface{}) error
DeepCopy 深度复制两个对象,src和dest必须是引用传递类型如指针,切片或字典
func GetActionMsg ¶
GetActionMsg 根据行为类型获取其简称,在行为类型不存在的情况下返回行为描述
func GetSingular ¶
Types ¶
type ApiObject ¶
type ApiObject interface { JSONMarshaler YAMLMarshaler MetadataGetter MetadataSetter MetaTypeGetter SpecHasher ConditionResetter Versioner GetKey() string SetNamespace(string) SetName(string) GetGVK() GVK SetGVK(gvk GVK) GetStatus() Status SetStatus(Status) SetStatusPhase(string) GetStatusPhase() string Sha256() string DeepCopyApiObject() ApiObject }
type ApiObjectAction ¶
type ApiObjectList ¶
type ApiObjectList []ApiObject
type BaseApiObj ¶
type BaseApiObj struct { MetaType `json:",inline" yaml:",inline"` BaseObj `json:",inline" yaml:",inline"` }
func (BaseApiObj) GetGVK ¶
func (o BaseApiObj) GetGVK() GVK
func (BaseApiObj) GetKey ¶
func (o BaseApiObj) GetKey() string
func (BaseApiObj) GetMetaType ¶
func (o BaseApiObj) GetMetaType() MetaType
func (*BaseApiObj) Init ¶
func (o *BaseApiObj) Init(apiVersion string, kind string)
func (*BaseApiObj) SetGVK ¶
func (o *BaseApiObj) SetGVK(gvk GVK)
type BaseObj ¶
func (BaseObj) GetMetadata ¶
func (BaseObj) GetStatusPhase ¶
func (*BaseObj) RaiseVersion ¶
func (o *BaseObj) RaiseVersion()
func (*BaseObj) ResetConditions ¶
func (o *BaseObj) ResetConditions()
func (*BaseObj) SetCreateTime ¶
func (*BaseObj) SetMetadata ¶
func (*BaseObj) SetNamespace ¶
func (*BaseObj) SetStatusPhase ¶
func (*BaseObj) SetUpdateTime ¶
type BaseRuntimeObj ¶
type BaseRuntimeObj struct {
BaseObj `json:",inline" yaml:",inline"`
}
type ConditionResetter ¶
type ConditionResetter interface {
ResetConditions()
}
type ConfigMapKeyRef ¶
type Conversion ¶
type Conversion struct {
// contains filtered or unexported fields
}
Conversion 结构转换方法注册器
func NewConversion ¶
func NewConversion() Conversion
func (*Conversion) GetConversionFunc ¶
func (c *Conversion) GetConversionFunc(srcGVK GVK, dstGVK GVK) (ConvertFunc, bool)
func (*Conversion) SetConversionFunc ¶
func (c *Conversion) SetConversionFunc(srcGVK GVK, dstGVK GVK, convertFunc ConvertFunc)
type ConvertByBytesFunc ¶
type JSONMarshaler ¶
type MetaTypeGetter ¶
type MetaTypeGetter interface {
GetMetaType() MetaType
}
type Metadata ¶
type MetadataGetter ¶
type MetadataGetter interface {
GetMetadata() Metadata
}
type MetadataSetter ¶
type NewByGVKFunc ¶
type OpOpt ¶
type OpOpt func(o *Option)
func WhenSpecChanged ¶
func WhenSpecChanged() OpOpt
func WithAllFields ¶
func WithAllFields() OpOpt
func WithFinalizer ¶
func WithFinalizer() OpOpt
type Option ¶
func (*Option) SetupOption ¶
type RuntimeObject ¶
type RuntimeObject interface { MetadataGetter }
type SortByCreateTime ¶
type SortByCreateTime ApiObjectList
func (SortByCreateTime) Len ¶
func (s SortByCreateTime) Len() int
func (SortByCreateTime) Less ¶
func (s SortByCreateTime) Less(i, j int) bool
func (SortByCreateTime) Swap ¶
func (s SortByCreateTime) Swap(i, j int)
type SortByRevision ¶
type SortByRevision ApiObjectList
func (SortByRevision) Len ¶
func (s SortByRevision) Len() int
func (SortByRevision) Less ¶
func (s SortByRevision) Less(i, j int) bool
func (SortByRevision) Swap ¶
func (s SortByRevision) Swap(i, j int)
type SpecHasher ¶
type Status ¶
func (*Status) GetCondition ¶
GetCondition 获取状态
func (*Status) SetCondition ¶
SetCondition 设置状态
func (*Status) UnsetCondition ¶
UnsetCondition 移除状态
type ValueFrom ¶
type ValueFrom struct {
ConfigMapKeyRef ConfigMapKeyRef
}
Click to show internal directories.
Click to hide internal directories.