Documentation ¶
Index ¶
- func CompareResourceVersion(rv1, rv2 string) bool
- func CreateOrUpdateRole(ctx context.Context, client kubernetes.Interface, ...) error
- func CreateRoleBinding(ctx context.Context, client kubernetes.Interface, domainID string, ...) error
- func CreateServiceToken(ctx context.Context, client kubernetes.Interface, domainID string) (*authenticationv1.TokenRequest, error)
- func ExtractConfigMap(p *corev1.ConfigMap) *corev1.ConfigMap
- func ExtractDomainDataAnnotations(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
- func ExtractDomainDataGrantAnnotations(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
- func ExtractDomainDataGrantLabels(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
- func ExtractDomainDataGrantSpec(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
- func ExtractDomainDataGrantStatus(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
- func ExtractDomainDataLabels(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
- func ExtractDomainDataSpec(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
- func ExtractPodAnnotations(p *corev1.Pod) *corev1.Pod
- func ExtractPodAnnotationsAndLabels(p *corev1.Pod) *corev1.Pod
- func ExtractPodLabels(p *corev1.Pod) *corev1.Pod
- func ExtractPodSpec(p *corev1.Pod) *corev1.Pod
- func ExtractPodStatus(p *corev1.Pod) *corev1.Pod
- func ExtractService(p *corev1.Service) *corev1.Service
- func ExtractServiceLabels(p *corev1.Service) *corev1.Service
- func ExtractTaskResource(p *kusciaapisv1alpha1.TaskResource) *kusciaapisv1alpha1.TaskResource
- func ExtractTaskResourceStatus(p *kusciaapisv1alpha1.TaskResource) *kusciaapisv1alpha1.TaskResource
- func GenerateServiceName(prefix, portName string) string
- func GetInterConnParties(annotations map[string]string) map[string]string
- func GetInterConnProtocolTypeByPartyAnnotation(key string) kusciaapisv1alpha1.InterConnProtocolType
- func GetKusciaJobCondition(status *kusciaapisv1alpha1.KusciaJobStatus, ...) (*kusciaapisv1alpha1.KusciaJobCondition, bool)
- func GetKusciaTaskCondition(status *kusciaapisv1alpha1.KusciaTaskStatus, ...) (*kusciaapisv1alpha1.KusciaTaskCondition, bool)
- func GetMasterDomain(domainLister kuscialistersv1alpha1.DomainLister, domainID string) (string, error)
- func GetTaskResourceCondition(trStatus *kusciaapisv1alpha1.TaskResourceStatus, ...) *kusciaapisv1alpha1.TaskResourceCondition
- func GetTaskResourceGroupCondition(trgStatus *kusciaapisv1alpha1.TaskResourceGroupStatus, ...) (*kusciaapisv1alpha1.TaskResourceGroupCondition, bool)
- func IsEmpty(v interface{}) bool
- func IsExistingTaskResourceGroupCondition(status *kusciaapisv1alpha1.TaskResourceGroupStatus, ...) bool
- func IsOuterBFIAInterConnDomain(nsLister corelisters.NamespaceLister, domainID string) bool
- func IsPartnerDomain(nsLister corelisters.NamespaceLister, domainID string) (bool, error)
- func MergeKusciaJobConditions(kusciaJob *kusciaapisv1alpha1.KusciaJob, ...)
- func MergeKusciaJobTaskStatus(kusciaJob *kusciaapisv1alpha1.KusciaJob, ...) bool
- func MergeKusciaTaskConditions(kusciaTask *kusciaapisv1alpha1.KusciaTask, ...)
- func MergeKusciaTaskPartyTaskStatus(kusciaTask *kusciaapisv1alpha1.KusciaTask, ...)
- func PatchConfigMap(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func PatchDomainData(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func PatchDomainDataGrant(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func PatchDomainDataGrantStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func PatchDomainDataStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func PatchPod(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func PatchPodStatus(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func PatchService(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func PatchTaskResource(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func PatchTaskResourceGroupStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, ...) error
- func SelectDeployTemplate(templates []kusciaapisv1alpha1.DeployTemplate, role string) (*kusciaapisv1alpha1.DeployTemplate, error)
- func SelfClusterAsInitiator(nsLister corelisters.NamespaceLister, domainID string, ...) bool
- func SetKusciaJobCondition(now metav1.Time, cond *kusciaapisv1alpha1.KusciaJobCondition, ...)
- func SetKusciaTaskCondition(now metav1.Time, cond *kusciaapisv1alpha1.KusciaTaskCondition, ...) bool
- func SetTaskResourceGroupCondition(now *metav1.Time, cond *kusciaapisv1alpha1.TaskResourceGroupCondition, ...) bool
- func SplitRSC(rsc string, n int) (string, error)
- func UpdateKusciaJob(kusciaClient kusciaclientset.Interface, kj *kusciaapisv1alpha1.KusciaJob, ...) (err error)
- func UpdateKusciaJobStage(kusciaClient kusciaclientset.Interface, kj *kusciaapisv1alpha1.KusciaJob, ...) error
- func UpdateKusciaJobStatus(kusciaClient kusciaclientset.Interface, ...) (err error)
- func UpdateKusciaTaskStatus(kusciaClient kusciaclientset.Interface, ...) (err error)
- func UpdateKusciaTaskStatusWithRetry(kusciaClient kusciaclientset.Interface, ...) (err error)
- func UpdateServiceAnnotations(kubeClient kubernetes.Interface, service *corev1.Service, at map[string]string) (err error)
- func ValidateK8sName(val string, fieldName string) error
- func ValidateServiceNamePrefix(val string, fieldName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareResourceVersion ¶
CompareResourceVersion is used to compare resource version.
func CreateOrUpdateRole ¶
func CreateOrUpdateRole(ctx context.Context, client kubernetes.Interface, roleLister rbaclisters.RoleLister, rootDir, domainID string, ownerRef *metav1.OwnerReference) error
func CreateRoleBinding ¶
func CreateRoleBinding(ctx context.Context, client kubernetes.Interface, domainID string, ownerRef *metav1.OwnerReference) error
func CreateServiceToken ¶
func CreateServiceToken(ctx context.Context, client kubernetes.Interface, domainID string) (*authenticationv1.TokenRequest, error)
func ExtractConfigMap ¶
ExtractConfigMap is used to extract configmap.
func ExtractDomainDataAnnotations ¶
func ExtractDomainDataAnnotations(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
ExtractDomainDataAnnotations is used to extract domaindata annotations.
func ExtractDomainDataGrantAnnotations ¶
func ExtractDomainDataGrantAnnotations(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
ExtractDomainDataGrantAnnotations is used to extract domaindatagrant annotations.
func ExtractDomainDataGrantLabels ¶
func ExtractDomainDataGrantLabels(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
ExtractDomainDataGrantLabels is used to extract domainadatagrant labels.
func ExtractDomainDataGrantSpec ¶
func ExtractDomainDataGrantSpec(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
ExtractDomainDataGrantSpec is used to extract domaindatagrant spec.
func ExtractDomainDataGrantStatus ¶
func ExtractDomainDataGrantStatus(p *kusciaapisv1alpha1.DomainDataGrant) *kusciaapisv1alpha1.DomainDataGrant
ExtractDomainDataGrantStatus is used to extract domaindatagrant status.
func ExtractDomainDataLabels ¶
func ExtractDomainDataLabels(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
ExtractDomainDataLabels is used to extract domainadata labels.
func ExtractDomainDataSpec ¶
func ExtractDomainDataSpec(p *kusciaapisv1alpha1.DomainData) *kusciaapisv1alpha1.DomainData
ExtractDomainDataSpec is used to extract domainData spec.
func ExtractPodAnnotations ¶
ExtractPodAnnotations is used to extract pod annotations.
func ExtractPodAnnotationsAndLabels ¶
ExtractPodAnnotationsAndLabels is used to extract pod annotations and labels.
func ExtractPodLabels ¶
ExtractPodLabels is used to extract pod labels.
func ExtractPodSpec ¶
ExtractPodSpec is used to extract pod spec.
func ExtractPodStatus ¶
ExtractPodStatus is used to extract pod status.
func ExtractService ¶
ExtractService is used to extract service.
func ExtractServiceLabels ¶
ExtractServiceLabels is used to extract service labels.
func ExtractTaskResource ¶
func ExtractTaskResource(p *kusciaapisv1alpha1.TaskResource) *kusciaapisv1alpha1.TaskResource
ExtractTaskResource is used to extract task resource.
func ExtractTaskResourceStatus ¶
func ExtractTaskResourceStatus(p *kusciaapisv1alpha1.TaskResource) *kusciaapisv1alpha1.TaskResource
ExtractTaskResourceStatus is used to extract task resource status.
func GenerateServiceName ¶
GenerateServiceName is used to generate service name. Service name generation rules: 1. If the first character is a number, add svc- as a prefix; 2. If the length of the name exceeds 63 characters, it will be truncated to 63 characters. 3. The final name must comply with DNS subdomain naming rules. 4. Services derivate from same task may have same prefix and different portName suffix segment.
func GetInterConnParties ¶
func GetInterConnProtocolTypeByPartyAnnotation ¶
func GetInterConnProtocolTypeByPartyAnnotation(key string) kusciaapisv1alpha1.InterConnProtocolType
func GetKusciaJobCondition ¶
func GetKusciaJobCondition(status *kusciaapisv1alpha1.KusciaJobStatus, condType kusciaapisv1alpha1.KusciaJobConditionType, generateCond bool) (*kusciaapisv1alpha1.KusciaJobCondition, bool)
GetKusciaJobCondition gets kuscia job condition.
func GetKusciaTaskCondition ¶
func GetKusciaTaskCondition(status *kusciaapisv1alpha1.KusciaTaskStatus, condType kusciaapisv1alpha1.KusciaTaskConditionType, generateCond bool) (*kusciaapisv1alpha1.KusciaTaskCondition, bool)
GetKusciaTaskCondition gets kuscia task condition.
func GetMasterDomain ¶
func GetMasterDomain(domainLister kuscialistersv1alpha1.DomainLister, domainID string) (string, error)
GetMasterDomain is used to get master domain id.
func GetTaskResourceCondition ¶
func GetTaskResourceCondition(trStatus *kusciaapisv1alpha1.TaskResourceStatus, condType kusciaapisv1alpha1.TaskResourceConditionType) *kusciaapisv1alpha1.TaskResourceCondition
GetTaskResourceCondition gets task resource condition.
func GetTaskResourceGroupCondition ¶
func GetTaskResourceGroupCondition(trgStatus *kusciaapisv1alpha1.TaskResourceGroupStatus, condType kusciaapisv1alpha1.TaskResourceGroupConditionType) (*kusciaapisv1alpha1.TaskResourceGroupCondition, bool)
GetTaskResourceGroupCondition is used to get task resource group condition.
func IsExistingTaskResourceGroupCondition ¶
func IsExistingTaskResourceGroupCondition(status *kusciaapisv1alpha1.TaskResourceGroupStatus, condType kusciaapisv1alpha1.TaskResourceGroupConditionType, condStatus corev1.ConditionStatus) bool
IsExistingTaskResourceGroupCondition checks if TaskResourceGroupCondition exists.
func IsOuterBFIAInterConnDomain ¶
func IsOuterBFIAInterConnDomain(nsLister corelisters.NamespaceLister, domainID string) bool
IsOuterBFIAInterConnDomain checks if outer domain with BFIA protocol.
func IsPartnerDomain ¶
func IsPartnerDomain(nsLister corelisters.NamespaceLister, domainID string) (bool, error)
IsPartnerDomain check if is partner domain.
func MergeKusciaJobConditions ¶
func MergeKusciaJobConditions(kusciaJob *kusciaapisv1alpha1.KusciaJob, conds []kusciaapisv1alpha1.KusciaJobCondition)
MergeKusciaJobConditions merges kuscia job conditions.
func MergeKusciaJobTaskStatus ¶
func MergeKusciaJobTaskStatus(kusciaJob *kusciaapisv1alpha1.KusciaJob, taskPhase map[string]kusciaapisv1alpha1.KusciaTaskPhase) bool
MergeKusciaJobTaskStatus merges task status of kuscia job.
func MergeKusciaTaskConditions ¶
func MergeKusciaTaskConditions(kusciaTask *kusciaapisv1alpha1.KusciaTask, conds []kusciaapisv1alpha1.KusciaTaskCondition)
MergeKusciaTaskConditions merges kuscia task conditions.
func MergeKusciaTaskPartyTaskStatus ¶
func MergeKusciaTaskPartyTaskStatus(kusciaTask *kusciaapisv1alpha1.KusciaTask, partyTaskStatus []kusciaapisv1alpha1.PartyTaskStatus)
MergeKusciaTaskPartyTaskStatus merges party task status of Kuscia task.
func PatchConfigMap ¶
func PatchConfigMap(ctx context.Context, kubeClient kubernetes.Interface, oldCm, newCm *corev1.ConfigMap) error
PatchConfigMap is used to patch configmap.
func PatchDomainData ¶
func PatchDomainData(ctx context.Context, kusciaClient kusciaclientset.Interface, oldDd, newDd *kusciaapisv1alpha1.DomainData) error
PatchDomainData is used to patch domaindata.
func PatchDomainDataGrant ¶
func PatchDomainDataGrant(ctx context.Context, kusciaClient kusciaclientset.Interface, oldDdg, newDdg *kusciaapisv1alpha1.DomainDataGrant) error
PatchDomainDataGrant is used to patch domaindatagrant.
func PatchDomainDataGrantStatus ¶
func PatchDomainDataGrantStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, oldDbg, newDbg *kusciaapisv1alpha1.DomainDataGrant) error
PatchDomainDataGrantStatus is used to patch domaindatagrant status.
func PatchDomainDataStatus ¶
func PatchDomainDataStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, oldDb, newDb *kusciaapisv1alpha1.DomainData) error
PatchDomainDataStatus is used to patch domaindata status.
func PatchPod ¶
func PatchPod(ctx context.Context, kubeClient kubernetes.Interface, oldPod, newPod *corev1.Pod) error
PatchPod is used to patch pod.
func PatchPodStatus ¶
func PatchPodStatus(ctx context.Context, kubeClient kubernetes.Interface, oldPod, newPod *corev1.Pod) error
PatchPodStatus is used to patch pod status.
func PatchService ¶
func PatchService(ctx context.Context, kubeClient kubernetes.Interface, oldSvc, newSvc *corev1.Service) error
PatchService is used to patch service.
func PatchTaskResource ¶
func PatchTaskResource(ctx context.Context, kusciaClient kusciaclientset.Interface, oldTr, newTr *kusciaapisv1alpha1.TaskResource) error
PatchTaskResource is used to patch task resource.
func PatchTaskResourceGroupStatus ¶
func PatchTaskResourceGroupStatus(ctx context.Context, kusciaClient kusciaclientset.Interface, oldTrg, newTrg *kusciaapisv1alpha1.TaskResourceGroup) error
PatchTaskResourceGroupStatus is used to patch task resource group status.
func SelectDeployTemplate ¶
func SelectDeployTemplate(templates []kusciaapisv1alpha1.DeployTemplate, role string) (*kusciaapisv1alpha1.DeployTemplate, error)
SelectDeployTemplate selects a matching template according to the role. value of templates[i].Role may have the following values: 'client', 'server', 'client,server', ... Matching process:
- if role [in] template role list, matched.
- if template role list is empty,template is universal.
- if role is empty,select the first template.
func SelfClusterAsInitiator ¶
func SelfClusterAsInitiator(nsLister corelisters.NamespaceLister, domainID string, annotations map[string]string) bool
SelfClusterAsInitiator checks if self cluster domain is scheduling party.
func SetKusciaJobCondition ¶
func SetKusciaJobCondition(now metav1.Time, cond *kusciaapisv1alpha1.KusciaJobCondition, status corev1.ConditionStatus, reason, message string)
SetKusciaJobCondition sets kuscia job condition.
func SetKusciaTaskCondition ¶
func SetKusciaTaskCondition(now metav1.Time, cond *kusciaapisv1alpha1.KusciaTaskCondition, condStatus corev1.ConditionStatus, condReason, condMessage string) bool
SetKusciaTaskCondition sets kuscia task condition.
func SetTaskResourceGroupCondition ¶
func SetTaskResourceGroupCondition(now *metav1.Time, cond *kusciaapisv1alpha1.TaskResourceGroupCondition, condStatus corev1.ConditionStatus, condReason string) bool
SetTaskResourceGroupCondition sets task resource group condition.
func UpdateKusciaJob ¶
func UpdateKusciaJob(kusciaClient kusciaclientset.Interface, kj *kusciaapisv1alpha1.KusciaJob, hasUpdated func(kusciaJob *kusciaapisv1alpha1.KusciaJob) bool, update func(kusciaJob *kusciaapisv1alpha1.KusciaJob), retries int) (err error)
UpdateKusciaJob updates kuscia job.
func UpdateKusciaJobStage ¶
func UpdateKusciaJobStage(kusciaClient kusciaclientset.Interface, kj *kusciaapisv1alpha1.KusciaJob, jobStage kusciaapisv1alpha1.JobStage, retries int) error
UpdateKusciaJobStage updates kuscia job stage.
func UpdateKusciaJobStatus ¶
func UpdateKusciaJobStatus(kusciaClient kusciaclientset.Interface, rawKj, curKj *kusciaapisv1alpha1.KusciaJob) (err error)
UpdateKusciaJobStatus will update kuscia job status. The function will retry updating if failed.
func UpdateKusciaTaskStatus ¶
func UpdateKusciaTaskStatus(kusciaClient kusciaclientset.Interface, rawKt, curKt *kusciaapisv1alpha1.KusciaTask) (err error)
UpdateKusciaTaskStatus updates kuscia task status.
func UpdateKusciaTaskStatusWithRetry ¶
func UpdateKusciaTaskStatusWithRetry(kusciaClient kusciaclientset.Interface, rawKt, curKt *kusciaapisv1alpha1.KusciaTask, retryCount int) (err error)
UpdateKusciaTaskStatusWithRetry updates kuscia task status with retry.
func UpdateServiceAnnotations ¶
func UpdateServiceAnnotations(kubeClient kubernetes.Interface, service *corev1.Service, at map[string]string) (err error)
UpdateServiceAnnotations updates service annotations.
func ValidateK8sName ¶
ValidateK8sName checks dns subdomain names
Types ¶
This section is empty.