Versions in this module Expand all Collapse all v0 v0.9.2 Dec 14, 2023 v0.0.1 Nov 22, 2023 Changes in this version + const DeployerPodForDeploymentAnnotation + const KubeSystemNamespace + var ErrNoRunningPods = errors.New("no active pods for controller") + var ErrReplicaSetNotFound = errors.New("replicaset not found") + var ErrUnSupportedKind = errors.New("unsupported workload kind") + func AggregateImagePullSecretsData(images ContainerImages, credentials map[string]docker.Auth) map[string][]byte + func AppendCustomLabels(configCustomLabels map[string]string, reportLabels map[string]string) + func AppendResourceLabels(configLabelsNames []string, resourceLabels map[string]string, ...) + func ComputeHash(obj interface{}) string + func ComputeSpecHash(obj client.Object) (string, error) + func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) + func GetPodSpec(obj client.Object) (corev1.PodSpec, error) + func GetTerminatedContainersStatusesByPod(pod *corev1.Pod) map[string]*corev1.ContainerStateTerminated + func GetWildcardServers(auths map[string]docker.Auth) []string + func IsBuiltInWorkload(controller *metav1.OwnerReference) bool + func IsClusterScopedKind(kind string) bool + func IsPodControlledByJobNotFound(err error) bool + func IsRoleRelatedNamespaceScope(kind Kind) bool + func IsRoleTypes(kind Kind) bool + func IsValidK8sKind(kind string) bool + func IsWorkload(kind string) bool + func MapContainerNamesToDockerAuths(images ContainerImages, auths map[string]docker.Auth) (map[string]docker.Auth, error) + func MapDockerRegistryServersToAuths(imagePullSecrets []corev1.Secret, multiSecretSupport bool) (map[string]docker.Auth, error) + func ObjectRefToLabels(obj ObjectRef) map[string]string + func ObjectToObjectMeta(obj client.Object, objectMeta *metav1.ObjectMeta) error + type CompatibleMgr interface + GetSupportedObjectByKind func(kind Kind, defaultObject client.Object) client.Object + func InitCompatibleMgr() (CompatibleMgr, error) + type CompatibleObjectMapper struct + func (o *CompatibleObjectMapper) GetSupportedObjectByKind(kind Kind, defaultObject client.Object) client.Object + type ContainerImages map[string]string + func GetContainerImagesFromContainersList(containers []corev1.Container) ContainerImages + func GetContainerImagesFromJob(job *batchv1.Job) (ContainerImages, error) + func GetContainerImagesFromPodSpec(spec corev1.PodSpec, skipInitContainers bool) ContainerImages + func (ci ContainerImages) AsJSON() (string, error) + func (ci ContainerImages) FromJSON(value string) error + type Kind string + const KindClusterRole + const KindClusterRoleBindings + const KindConfigMap + const KindCronJob + const KindCustomResourceDefinition + const KindDaemonSet + const KindDeployment + const KindDeploymentConfig + const KindIngress + const KindJob + const KindLimitRange + const KindNetworkPolicy + const KindNode + const KindPod + const KindReplicaSet + const KindReplicationController + const KindResourceQuota + const KindRole + const KindRoleBinding + const KindService + const KindStatefulSet + type LogsReader interface + GetLogsByJobAndContainerName func(ctx context.Context, job *batchv1.Job, containerName string) (io.ReadCloser, error) + GetTerminatedContainersStatusesByJob func(ctx context.Context, job *batchv1.Job) (map[string]*corev1.ContainerStateTerminated, error) + func NewLogsReader(clientset kubernetes.Interface) LogsReader + type ObjectRef struct + Kind Kind + Name string + Namespace string + func ObjectRefFromKindAndObjectKey(kind Kind, name client.ObjectKey) ObjectRef + func ObjectRefFromObjectMeta(objectMeta metav1.ObjectMeta) (ObjectRef, error) + type ObjectResolver struct + func NewObjectResolver(c client.Client, cm CompatibleMgr) ObjectResolver + func (o *ObjectResolver) CronJobByJob(ctx context.Context, job *batchv1.Job) (client.Object, error) + func (o *ObjectResolver) GetActivePodsMatchingLabels(ctx context.Context, namespace string, labels map[string]string) ([]corev1.Pod, error) + func (o *ObjectResolver) GetNodeName(ctx context.Context, obj client.Object) (string, error) + func (o *ObjectResolver) IsActiveReplicaSet(ctx context.Context, workloadObj client.Object, ...) (bool, error) + func (o *ObjectResolver) IsActiveReplicationController(ctx context.Context, workloadObj client.Object, ...) (bool, error) + func (o *ObjectResolver) JobByPod(ctx context.Context, pod *corev1.Pod) (*batchv1.Job, error) + func (o *ObjectResolver) ObjectFromObjectRef(ctx context.Context, ref ObjectRef) (client.Object, error) + func (o *ObjectResolver) RelatedReplicaSetName(ctx context.Context, object ObjectRef) (string, error) + func (o *ObjectResolver) ReplicaSetByDeployment(ctx context.Context, deployment *appsv1.Deployment) (*appsv1.ReplicaSet, error) + func (o *ObjectResolver) ReplicaSetByDeploymentRef(ctx context.Context, deploymentRef ObjectRef) (*appsv1.ReplicaSet, error) + func (o *ObjectResolver) ReplicaSetByPod(ctx context.Context, pod *corev1.Pod) (*appsv1.ReplicaSet, error) + func (o *ObjectResolver) ReplicaSetByPodRef(ctx context.Context, object ObjectRef) (*appsv1.ReplicaSet, error) + func (o *ObjectResolver) ReportOwner(ctx context.Context, obj client.Object) (client.Object, error) + type Resource struct + ForObject client.Object + Kind Kind + OwnsObject client.Object + func (r *Resource) GetWorkloadResource(kind string, object client.Object, resolver ObjectResolver) error + type SecretsReader interface + CredentialsByServer func(ctx context.Context, workload client.Object, secretsInfo map[string]string, ...) (map[string]docker.Auth, error) + ListByLocalObjectReferences func(ctx context.Context, refs []corev1.LocalObjectReference, ns string) ([]corev1.Secret, error) + ListImagePullSecretsByPodSpec func(ctx context.Context, spec corev1.PodSpec, ns string) ([]corev1.Secret, error) + func NewSecretsReader(c client.Client) SecretsReader