Versions in this module Expand all Collapse all v1 v1.0.1 Nov 9, 2023 v1.0.0 Nov 9, 2023 Changes in this version + const PortForwardProtocolV1Name + const ResourcePods + var AllVerbs = []string + var ExtCheckForResource = map[string][]string + var IoStreams = &genericclioptions.IOStreams + var PermissionDenied = errors.New("Permission Denied") + func AddMetas(ut *unstructured.Unstructured, flags *ApplyFlags) + func AuthCheck(namespace, kubeConfig string, cmd *cobra.Command) bool + func CheckForResource(kubeConfigContent, namespace string, verbs []string, passWhenTimeout bool, ...) error + func CheckIfDeploymentIsReplicaFailure(deploy *v1.Deployment) (bool, string, string, error) + func DeleteResourceInfo(info *resource.Info) error + func EnhanceListError(err error, opts metav1.ListOptions, subj string) error + func Execute(method string, url *url.URL, config *restclient.Config, stdin io.Reader, ...) error + func FollowContinue(initialOpts *metav1.ListOptions, ...) error + func GetCmd(cmd *cobra.Command, from []string) []string + func GetControllerOfNoCopy(refs []metav1.OwnerReference) *metav1.OwnerReference + func GetKubeContentFromPath(kubePath string) ([]byte, error) + func GetNamespaceFromKubeConfig(kubeConfig string) (string, error) + func GetYamlFilesAndDirs(path string, ignorePaths []string) ([]string, []string, error) + func IsNamespaced(gvr schema.GroupVersionResource, mapper meta.RESTMapper) (bool, error) + func LoadValidManifest(path []string, ignorePaths ...[]string) []string + func Must(err error) + func MustI(err error, s string) + func NewAuthCheckManager(kubeConfigPath string) *authCheckManager + func NewKustomizeResourceReader(path string) *kustomizeResourceReader + func NewManifestResourceReader(files []string) *manifestResourceReader + type ApplyFlags struct + BeforeApply func(string) error + DoApply bool + MergeableAnnotation map[string]string + MergeableLabel map[string]string + func StandardNocalhostMetas(releaseName, releaseNamespace string) *ApplyFlags + func (a *ApplyFlags) SetBeforeApply(fun func(string) error) *ApplyFlags + func (a *ApplyFlags) SetDoApply(doApply bool) *ApplyFlags + type AuthChecker struct + Name string + ResourceArg string + Verb []string + Version string + type ClientGoUtils struct + ClientConfig clientcmd.ClientConfig + ClientSet *kubernetes.Clientset + func NewClientGoUtils(kubeConfigPath string, namespace string) (*ClientGoUtils, error) + func (c *ClientGoUtils) AddClusterRoleToRoleBinding(roleBinding, clusterRole, serviceAccount string) error + func (c *ClientGoUtils) Apply(files []string, continueOnError bool, flags *ApplyFlags, kustomize string) error + func (c *ClientGoUtils) ApplyAndWait(files []string, continueOnError bool, flags *ApplyFlags) error + func (c *ClientGoUtils) ApplyAndWaitFor(manifests string, continueOnError bool, flags *ApplyFlags) error + func (c *ClientGoUtils) ApplyResourceInfo(info *resource.Info, af *ApplyFlags) error + func (c *ClientGoUtils) CheckDeploymentReady(name string) (bool, error) + func (c *ClientGoUtils) CheckExistNameSpace(name string) error + func (c *ClientGoUtils) Context(ctx context.Context) *ClientGoUtils + func (c *ClientGoUtils) CreateAdminClusterRole(name string) (*v1.ClusterRole, error) + func (c *ClientGoUtils) CreateAdminClusterRoleINE(name string) (*v1.ClusterRole, error) + func (c *ClientGoUtils) CreateClusterRole(name string, rule []rbacv1.PolicyRule) (*v1.ClusterRole, error) + func (c *ClientGoUtils) CreateDeployment(deploy *v1.Deployment) (*v1.Deployment, error) + func (c *ClientGoUtils) CreateDeploymentAndWait(deployment *v1.Deployment) (*v1.Deployment, error) + func (c *ClientGoUtils) CreateJob(job *batchv1.Job) (*batchv1.Job, error) + func (c *ClientGoUtils) CreateNameSpace(name string) error + func (c *ClientGoUtils) CreateNamespaceINE(ns string) error + func (c *ClientGoUtils) CreatePVC(name string, labels map[string]string, annotations map[string]string, ...) (*v1.PersistentVolumeClaim, error) + func (c *ClientGoUtils) CreatePod(pod *corev1.Pod) (*corev1.Pod, error) + func (c *ClientGoUtils) CreatePortForwarder(pod string, fps []*ForwardPort, readyChan, stopChan chan struct{}, ...) (*PortForwarder, error) + func (c *ClientGoUtils) CreateRoleBindingWithClusterRole(name, clusterRoleName string) (*v1.RoleBinding, error) + func (c *ClientGoUtils) CreateRoleBindingWithClusterRoleINE(name, clusterRoleName string) (*v1.RoleBinding, error) + func (c *ClientGoUtils) CreateSecret(secret *corev1.Secret, options metav1.CreateOptions) (*corev1.Secret, error) + func (c *ClientGoUtils) CreateServiceAccount(name string) (*corev1.ServiceAccount, error) + func (c *ClientGoUtils) CreateServiceAccountINE(name string) (*corev1.ServiceAccount, error) + func (c *ClientGoUtils) CreateStatefulSet(s *v1.StatefulSet) (*v1.StatefulSet, error) + func (c *ClientGoUtils) CreateStatefulSetAndWait(s *v1.StatefulSet) (*v1.StatefulSet, error) + func (c *ClientGoUtils) Delete(files []string, continueOnError bool, flags *ApplyFlags, kustomize string) error + func (c *ClientGoUtils) DeleteConfigMapByName(name string) error + func (c *ClientGoUtils) DeleteDeployment(name string, wait bool) error + func (c *ClientGoUtils) DeleteEvent(name string) error + func (c *ClientGoUtils) DeleteEvents(evs []corev1.Event, continueOnErr bool) error + func (c *ClientGoUtils) DeleteJob(name string) error + func (c *ClientGoUtils) DeleteNameSpace(name string, wait bool) error + func (c *ClientGoUtils) DeletePVC(name string) error + func (c *ClientGoUtils) DeletePod(podName string, wait bool, duration time.Duration) error + func (c *ClientGoUtils) DeletePodByName(name string, gracePeriodSeconds int64) error + func (c *ClientGoUtils) DeleteSecret(name string) error + func (c *ClientGoUtils) DeleteStatefulSet(name string) error + func (c *ClientGoUtils) DeleteStatefulSetAndPVC(name string) error + func (c *ClientGoUtils) Discovery() + func (c *ClientGoUtils) Exec(podName string, containerName string, command []string) error + func (c *ClientGoUtils) ExecShell(podName string, containerName string, shell, banner string) error + func (c *ClientGoUtils) FieldSelector(f string) *ClientGoUtils + func (c *ClientGoUtils) Forward(pod string, localPort, remotePort int, readyChan, stopChan chan struct{}, ...) error + func (c *ClientGoUtils) ForwardPortForwardByPod(pod string, localPort, remotePort int, readyChan, stopChan chan struct{}, ...) error + func (c *ClientGoUtils) Get(resourceType string, resourceName string) (*runtime.Object, error) + func (c *ClientGoUtils) GetAPIGroupResources() ([]*restmapper.APIGroupResources, error) + func (c *ClientGoUtils) GetClusterRole(name string) (*v1.ClusterRole, error) + func (c *ClientGoUtils) GetConfigMaps(name string) (*v1.ConfigMap, error) + func (c *ClientGoUtils) GetContext() context.Context + func (c *ClientGoUtils) GetCopy() *ClientGoUtils + func (c *ClientGoUtils) GetCronJobs(name string) (*v1beta1.CronJob, error) + func (c *ClientGoUtils) GetCronJobsClient() batchV1beta1.CronJobInterface + func (c *ClientGoUtils) GetDaemonSet(name string) (*v1.DaemonSet, error) + func (c *ClientGoUtils) GetDaemonSetClient() appsV1.DaemonSetInterface + func (c *ClientGoUtils) GetDefaultNamespace() (string, error) + func (c *ClientGoUtils) GetDeployment(name string) (*v1.Deployment, error) + func (c *ClientGoUtils) GetDeploymentClient() appsV1.DeploymentInterface + func (c *ClientGoUtils) GetDiscoveryClient() (*discovery.DiscoveryClient, error) + func (c *ClientGoUtils) GetDynamicClient() dynamic.Interface + func (c *ClientGoUtils) GetJobs(name string) (*batchv1.Job, error) + func (c *ClientGoUtils) GetJobsClient() batchV1.JobInterface + func (c *ClientGoUtils) GetNameSpace() string + func (c *ClientGoUtils) GetNodesList() (*corev1.NodeList, error) + func (c *ClientGoUtils) GetPod(name string) (*corev1.Pod, error) + func (c *ClientGoUtils) GetPodClient() coreV1.PodInterface + func (c *ClientGoUtils) GetPvcByLabels(labels map[string]string) ([]v1.PersistentVolumeClaim, error) + func (c *ClientGoUtils) GetPvcByName(name string) (*v1.PersistentVolumeClaim, error) + func (c *ClientGoUtils) GetReplicaSetsByDeployment(deploymentName string) (map[int]*v1.ReplicaSet, error) + func (c *ClientGoUtils) GetResourceInfo(resourceType string, resourceName string) (*resource.Info, error) + func (c *ClientGoUtils) GetResourceInfoFromReader(reader io.Reader, continueOnError bool) ([]*resource.Info, error) + func (c *ClientGoUtils) GetResourceInfoFromString(str string, continueOnError bool) ([]*resource.Info, error) + func (c *ClientGoUtils) GetResourcesByRestClient(gv *schema.GroupVersion, resource string, result runtime.Object) error + func (c *ClientGoUtils) GetRestClient(gv *schema.GroupVersion) (*rest.RESTClient, error) + func (c *ClientGoUtils) GetSecret(name string) (*corev1.Secret, error) + func (c *ClientGoUtils) GetService(name string) (*corev1.Service, error) + func (c *ClientGoUtils) GetServiceAccount(name string) (*corev1.ServiceAccount, error) + func (c *ClientGoUtils) GetSortedReplicaSetsByDeployment(deployment string) ([]*v1.ReplicaSet, error) + func (c *ClientGoUtils) GetStatefulSet(name string) (*v1.StatefulSet, error) + func (c *ClientGoUtils) GetStatefulSetClient() appsV1.StatefulSetInterface + func (c *ClientGoUtils) GetUnstructured(resourceType string, resourceName string) (*unstructured.Unstructured, error) + func (c *ClientGoUtils) GetUnstructuredFromString(str string) (*unstructured.Unstructured, error) + func (c *ClientGoUtils) IncludeDeletedResources(i bool) *ClientGoUtils + func (c *ClientGoUtils) IsClusterAdmin() bool + func (c *ClientGoUtils) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) + func (c *ClientGoUtils) KubeConfigFilePath() string + func (c *ClientGoUtils) Labels(labels map[string]string) *ClientGoUtils + func (c *ClientGoUtils) ListConfigMaps() ([]v1.ConfigMap, error) + func (c *ClientGoUtils) ListDaemonSets() ([]v1.DaemonSet, error) + func (c *ClientGoUtils) ListDeployments() ([]v1.Deployment, error) + func (c *ClientGoUtils) ListEvents() ([]corev1.Event, error) + func (c *ClientGoUtils) ListEventsByReplicaSet(rsName string) ([]corev1.Event, error) + func (c *ClientGoUtils) ListEventsByStatefulSet(name string) ([]corev1.Event, error) + func (c *ClientGoUtils) ListHPA() ([]autoscalingv1.HorizontalPodAutoscaler, error) + func (c *ClientGoUtils) ListJobs() (*batchv1.JobList, error) + func (c *ClientGoUtils) ListLatestRevisionPodsByDeployment(deployName string) ([]corev1.Pod, error) + func (c *ClientGoUtils) ListPods() ([]corev1.Pod, error) + func (c *ClientGoUtils) ListPodsByCronJob(name string) (*corev1.PodList, error) + func (c *ClientGoUtils) ListPodsByDaemonSet(name string) ([]corev1.Pod, error) + func (c *ClientGoUtils) ListPodsByDeployment(name string) (*corev1.PodList, error) + func (c *ClientGoUtils) ListPodsByJob(name string) (*corev1.PodList, error) + func (c *ClientGoUtils) ListPodsByLabels(labelMap map[string]string) ([]corev1.Pod, error) + func (c *ClientGoUtils) ListPodsByStatefulSet(name string) (*corev1.PodList, error) + func (c *ClientGoUtils) ListPodsOfDeployment(deployName string) ([]corev1.Pod, error) + func (c *ClientGoUtils) ListPvcs() ([]v1.PersistentVolumeClaim, error) + func (c *ClientGoUtils) ListResourceInfo(resourceType string) ([]*resource.Info, error) + func (c *ClientGoUtils) ListStatefulSets() ([]v1.StatefulSet, error) + func (c *ClientGoUtils) NameSpace(namespace string) *ClientGoUtils + func (c *ClientGoUtils) NewFactory() cmdutil.Factory + func (c *ClientGoUtils) Patch(resourceType string, name string, patchContent string, pathType string) error + func (c *ClientGoUtils) ResourceFor(resourceArg string, tryLoadFromCache bool) schema.GroupVersionResource + func (c *ClientGoUtils) ResourceForGVK(gvk schema.GroupVersionKind) (schema.GroupVersionResource, bool, error) + func (c *ClientGoUtils) ScaleDeploymentReplicasToOne(name string) error + func (c *ClientGoUtils) ScaleStatefulSetReplicasToOne(name string) error + func (c *ClientGoUtils) SearchEvents(objOrRef runtime.Object) (*corev1.EventList, error) + func (c *ClientGoUtils) UpdateConfigMaps(cm *v1.ConfigMap) (*v1.ConfigMap, error) + func (c *ClientGoUtils) UpdateCronJob(cj *batchv1beta1.CronJob) (*batchv1beta1.CronJob, error) + func (c *ClientGoUtils) UpdateDaemonSet(ds *v1.DaemonSet) (*v1.DaemonSet, error) + func (c *ClientGoUtils) UpdateDeployment(deployment *v1.Deployment, wait bool) (*v1.Deployment, error) + func (c *ClientGoUtils) UpdateHPA(hpa *autoscalingv1.HorizontalPodAutoscaler) (*autoscalingv1.HorizontalPodAutoscaler, error) + func (c *ClientGoUtils) UpdatePod(pod *corev1.Pod) (*corev1.Pod, error) + func (c *ClientGoUtils) UpdateReplicaSet(rs *v1.ReplicaSet) (*v1.ReplicaSet, error) + func (c *ClientGoUtils) UpdateSecret(secret *corev1.Secret, options metav1.UpdateOptions) (*corev1.Secret, error) + func (c *ClientGoUtils) UpdateStatefulSet(statefulSet *v1.StatefulSet, wait bool) (*v1.StatefulSet, error) + func (c *ClientGoUtils) WaitDeploymentToBeReady(name string) error + func (c *ClientGoUtils) WaitForResourceReady(resourceType ResourceType, name string, ...) error + func (c *ClientGoUtils) WaitJobToBeReady(name, format string) error + func (c *ClientGoUtils) WaitLatestRevisionReady(deploymentName string) error + func (c *ClientGoUtils) WaitStatefulSetToBeReady(name string) error + type ClientgoPortForwarder struct + func (f *ClientgoPortForwarder) ForwardPorts(method string, url *url.URL, opts portforward.PortForwardOptions) error + func (f ClientgoPortForwarder) GetPorts() ([]ForwardedPort, error) + type ErrorType string + const InvalidYaml + type ForwardPort struct + LocalPort int + RemotePort int + type ForwardedPort struct + Local uint16 + Remote uint16 + type PortForwardAPodRequest struct + Listen []string + LocalPort int + Pod corev1.Pod + PodPort int + ReadyCh chan struct{} + StopCh <-chan struct{} + Streams genericclioptions.IOStreams + type PortForwardFlags struct + ForwardPort string + ReadyChannel chan struct{} + ResourcesName string + StopChannel chan struct{} + Streams genericclioptions.IOStreams + type PortForwarder struct + Ready chan struct{} + func New(dialer httpstream.Dialer, ports []string, stopChan <-chan struct{}, ...) (*PortForwarder, error) + func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, ...) (*PortForwarder, error) + func (pf *PortForwarder) Close() + func (pf *PortForwarder) ForwardPorts() error + func (pf *PortForwarder) GetPorts() ([]ForwardedPort, error) + type Resource struct + func NewResourceFromStr(manifest string) *Resource + func (r *Resource) GetResourceInfo(c *ClientGoUtils, continueOnError bool) ([]*resource.Info, error) + func (r Resource) Append(s string) + func (r Resource) String() string + type ResourceList []*resource.Info + func (r *ResourceList) Append(val *resource.Info) + func (r ResourceList) Contains(info *resource.Info) bool + func (r ResourceList) Difference(rs ResourceList) ResourceList + func (r ResourceList) Filter(fn func(*resource.Info) bool) ResourceList + func (r ResourceList) Get(info *resource.Info) *resource.Info + func (r ResourceList) Intersect(rs ResourceList) ResourceList + func (r ResourceList) Visit(fn resource.VisitorFunc) error + func (r ResourceList) Visits(fns []resource.VisitorFunc) error + type ResourceReader interface + LoadResource func() (*Resource, error) + type ResourceType string + const DeploymentType + const JobType + const StatefulSetType + type TypedError struct + ErrorType ErrorType + Mes string