Versions in this module Expand all Collapse all v0 v0.0.10 Apr 10, 2026 v0.0.9 Mar 17, 2026 Changes in this version + const ANNOTATION_CONFIGMAP_MOUNT + const ANNOTATION_SECRET_MOUNT + var WORKLOAD_KIND_NAME = map[int32]string + var WORKLOAD_KIND_VALUE = map[string]int32 + func FormatContainerState(stage corev1.ContainerState) string + func GetContainerFromPodSpec(spec v1.PodSpec, name string) *v1.Container + func GetContainerFromPodTemplate(temp v1.PodTemplateSpec, name string) *v1.Container + func GetPodContainerStatusByName(pod *corev1.Pod, containerName string) *corev1.ContainerStatus + func GetPrimaryContainerName(spec v1.PodSpec) string + func HoldContaienrCmd(d time.Duration) []string + func InjectContainerEnvVars(c *v1.Container, envs []v1.EnvVar) + func InjectJobAnnotations(pod *v1.Job, annotations map[string]string) + func InjectJobLabels(pod *v1.Job, labels map[string]string) + func InjectPodConfigMapVolume(pod *v1.PodSpec, cs ...*v1.ConfigMap) + func InjectPodEnvVars(pod *v1.PodSpec, envs []v1.EnvVar) + func InjectPodSecretVolume(pod *v1.PodSpec, ss ...*v1.Secret) + func InjectPodTemplateSpecAnnotations(pod *v1.PodTemplateSpec, key, value string) + func InjectPodTemplateSpecLabel(pod *v1.PodTemplateSpec, key, value string) + func NewConfigMapVolume(cm *v1.ConfigMap) v1.Volume + func NewSecretVolume(secret *v1.Secret) v1.Volume + func NewVolumeMount(readonly bool, vs []MountVolume) []v1.VolumeMount + func WaitForContainerRunning(containerName string, printer terminal.Logger) watchtools.ConditionFunc + type Client struct + func NewWorkload(cs *kubernetes.Clientset, restconf *rest.Config) *Client + func (b *Client) CreateCronJob(ctx context.Context, job *v1.CronJob) (*v1.CronJob, error) + func (b *Client) CreateJob(ctx context.Context, job *v1.Job) (*v1.Job, error) + func (b *Client) DeleteCronJob(ctx context.Context, req *meta.DeleteRequest) error + func (b *Client) GetCronJob(ctx context.Context, req *meta.GetRequest) (*v1.CronJob, error) + func (b *Client) GetJob(ctx context.Context, req *meta.GetRequest) (*v1.Job, error) + func (b *Client) ListCronJob(ctx context.Context, req *meta.ListRequest) (*v1.CronJobList, error) + func (b *Client) ListJob(ctx context.Context, req *meta.ListRequest) (*v1.JobList, error) + func (b *Client) UpdateCronJob(ctx context.Context, job *v1.CronJob) (*v1.CronJob, error) + func (b *Client) UpdateJob(ctx context.Context, job *v1.Job) (*v1.Job, error) + func (c *Client) CopyPodRun(ctx context.Context, req *CopyPodRunRequest) (*v1.Pod, error) + func (c *Client) CreateDaemonSet(ctx context.Context, obj *appsv1.DaemonSet) (*appsv1.DaemonSet, error) + func (c *Client) CreateDeployment(ctx context.Context, req *appsv1.Deployment) (*appsv1.Deployment, error) + func (c *Client) CreatePod(ctx context.Context, pod *v1.Pod, req *meta.CreateRequest) (*v1.Pod, error) + func (c *Client) CreateStatefulSet(ctx context.Context, req *appsv1.StatefulSet) (*appsv1.StatefulSet, error) + func (c *Client) DebugPod(ctx context.Context, req *DebugPodRequest) error + func (c *Client) Delete(ctx context.Context, wl *WorkLoad) (*WorkLoad, error) + func (c *Client) DeleteDaemonSet(ctx context.Context, req *meta.DeleteRequest) error + func (c *Client) DeleteDeployment(ctx context.Context, req *meta.DeleteRequest) error + func (c *Client) DeleteJob(ctx context.Context, req *meta.DeleteRequest) error + func (c *Client) DeletePod(ctx context.Context, req *meta.DeleteRequest) error + func (c *Client) DeleteStatefulSet(ctx context.Context, req *meta.DeleteRequest) error + func (c *Client) Get(ctx context.Context, wl *WorkLoad, req *meta.GetRequest) error + func (c *Client) GetDaemonSet(ctx context.Context, req *meta.GetRequest) (*appsv1.DaemonSet, error) + func (c *Client) GetDeployment(ctx context.Context, req *meta.GetRequest) (*appsv1.Deployment, error) + func (c *Client) GetPod(ctx context.Context, req *meta.GetRequest) (*v1.Pod, error) + func (c *Client) GetStatefulSet(ctx context.Context, req *meta.GetRequest) (*appsv1.StatefulSet, error) + func (c *Client) ListDaemonSet(ctx context.Context, req *meta.ListRequest) (*appsv1.DaemonSetList, error) + func (c *Client) ListDeployment(ctx context.Context, req *meta.ListRequest) (*appsv1.DeploymentList, error) + func (c *Client) ListPod(ctx context.Context, req *meta.ListRequest) (*v1.PodList, error) + func (c *Client) ListStatefulSet(ctx context.Context, req *meta.ListRequest) (*appsv1.StatefulSetList, error) + func (c *Client) LoginContainer(ctx context.Context, req *LoginContainerRequest) error + func (c *Client) ReDeploy(ctx context.Context, req *meta.GetRequest) (*appsv1.Deployment, error) + func (c *Client) Run(ctx context.Context, wl *WorkLoad) (*WorkLoad, error) + func (c *Client) ScaleDeployment(ctx context.Context, req *meta.ScaleRequest) (*v1.Scale, error) + func (c *Client) SetImage(ctx context.Context, resourceType WORKLOAD_KIND, ...) (v any, err error) + func (c *Client) Update(ctx context.Context, wl *WorkLoad) (*WorkLoad, error) + func (c *Client) UpdateDaemonSet(ctx context.Context, obj *appsv1.DaemonSet) (*appsv1.DaemonSet, error) + func (c *Client) UpdateDeployment(ctx context.Context, req *appsv1.Deployment) (*appsv1.Deployment, error) + func (c *Client) UpdateStatefulSet(ctx context.Context, req *appsv1.StatefulSet) (*appsv1.StatefulSet, error) + func (c *Client) WaitForPodCondition(ctx context.Context, req *WaitForContainerRequest) (*corev1.Pod, error) + func (c *Client) WatchContainerLog(ctx context.Context, req *WatchContainerLogRequest) (io.ReadCloser, error) + func (c *Client) WatchDeployment(ctx context.Context, req *appsv1.Deployment) (watch.Interface, error) + type ContainerTerminal interface + type CopyPodRunRequest struct + Attach bool + ExecContainer string + ExecHoldCmd []string + ExecRunCmd []string + Remove bool + SourcePod *meta.GetRequest + TargetPodMeta metav1.ObjectMeta + TargetPodOpts *meta.CreateRequest + Terminal *terminal.WebSocketTerminal + TerminationGracePeriodSeconds int64 + func NewCopyPodRunRequest() *CopyPodRunRequest + func (r *CopyPodRunRequest) SetAttachTerminal(term *terminal.WebSocketTerminal) + func (r *CopyPodRunRequest) SetDefaultExecContainer(containerName string) + type DebugPodRequest struct + EphemeralContainer corev1.EphemeralContainer + Excutor *terminal.WebSocketTerminal + type EnvVarSet struct + Items []*v1.EnvVar + func NewEnvVarSet(envs []v1.EnvVar) *EnvVarSet + func (s *EnvVarSet) Add(item *v1.EnvVar) + func (s *EnvVarSet) EnvVars() (envs []v1.EnvVar) + func (s *EnvVarSet) GetOrNewEnv(name string) *v1.EnvVar + func (s *EnvVarSet) String() string + type EventNotifier func(textMsg string) + type LoginContainerRequest struct + Command []string + ContainerName string + Executor ContainerTerminal + Namespace string + PodName string + func NewLoginContainerRequest(ce ContainerTerminal) *LoginContainerRequest + func (req *LoginContainerRequest) String() string + func (req *LoginContainerRequest) Validate() error + type MountVolume struct + Path string + Volume v1.Volume + func NewMountVolume(v v1.Volume, path string) MountVolume + type POD_STATUS int + const POD_STATUS_CONTAINER_READY + const POD_STATUS_INITIALIZED + const POD_STATUS_PENDDING + const POD_STATUS_POD_READY + const POD_STATUS_SCHEDULED + func GetPodStatus(p *v1.Pod) POD_STATUS + func (s POD_STATUS) String() string + type SystemVaraible struct + Image string + WorkloadName string + func NewSystemVaraible() *SystemVaraible + func (v *SystemVaraible) ImageDetail() (addr, version string) + type WORKLOAD_KIND int32 + const WORKLOAD_KIND_CRONJOB + const WORKLOAD_KIND_DAEMONSET + const WORKLOAD_KIND_DEPLOYMENT + const WORKLOAD_KIND_JOB + const WORKLOAD_KIND_REPLICASET + const WORKLOAD_KIND_STATEFULSET + func ParseWorkloadKindFromString(str string) (WORKLOAD_KIND, error) + func (t *WORKLOAD_KIND) UnmarshalJSON(b []byte) error + func (t WORKLOAD_KIND) Equal(target WORKLOAD_KIND) bool + func (t WORKLOAD_KIND) IsIn(targets ...WORKLOAD_KIND) bool + func (t WORKLOAD_KIND) MarshalJSON() ([]byte, error) + func (t WORKLOAD_KIND) String() string + type WORKLOAD_STAGE int32 + const WORKLOAD_STAGE_ACTIVE + const WORKLOAD_STAGE_ERROR + const WORKLOAD_STAGE_PENDDING + const WORKLOAD_STAGE_PROGERESS + type WaitForContainerRequest struct + ContainerName string + ExitCondition watchtools.ConditionFunc + Namespace string + PodName string + TimoutSecond int + type WatchContainerLogRequest struct + Namespace string + PodName string + func NewWatchContainerLogRequest() *WatchContainerLogRequest + func (req *WatchContainerLogRequest) Validate() error + type WorkLoad struct + CronJob *batchv1.CronJob + DaemonSet *appsv1.DaemonSet + Deployment *appsv1.Deployment + Job *batchv1.Job + StatefulSet *appsv1.StatefulSet + WorkloadKind WORKLOAD_KIND + func NewWorkLoad() *WorkLoad + func ParseWorkloadFromYaml(kindStr string, workload string) (w *WorkLoad, err error) + func (w *WorkLoad) GetContaineByName(containerName string) *v1.Container + func (w *WorkLoad) GetContainerImageVersion(containerName string) string + func (w *WorkLoad) GetObjectMeta() *metav1.ObjectMeta + func (w *WorkLoad) GetPodTemplateSpec() (podSpec *v1.PodTemplateSpec) + func (w *WorkLoad) GetServiceContainer(serviceName string) *v1.Container + func (w *WorkLoad) MustToYaml() string + func (w *WorkLoad) SetAnnotations(key, value string) + func (w *WorkLoad) SetDefaultNamespace(ns string) + func (w *WorkLoad) SetMatchLabel(k, v string) + func (w *WorkLoad) Status() *WorkloadStatus + func (w *WorkLoad) SystemVaraible(serviceName string) *SystemVaraible + type WorkloadStatus struct + Message string + Reason string + Stage WORKLOAD_STAGE + func GetCronJobStatus(*v1.CronJob) *WorkloadStatus + func GetDaemonSetStatus(*appsv1.DaemonSet) *WorkloadStatus + func GetDeploymentStatus(obj *appsv1.Deployment) *WorkloadStatus + func GetJobStatus(*v1.Job) *WorkloadStatus + func GetStatefulSetStatus(obj *appsv1.StatefulSet) *WorkloadStatus + func NewWorklaodStatus() *WorkloadStatus + func (w *WorkloadStatus) UpdateDeploymentStatus(cond appsv1.DeploymentCondition)