Versions in this module Expand all Collapse all v0 v0.15.15 Oct 9, 2023 Changes in this version + const DeployerPodForDeploymentLabel + 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 ComputeHash(obj interface{}) string + func ComputeSpecHash(obj client.Object) (string, error) + func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) + func GVRForResource(mapper meta.RESTMapper, resource string) (gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, err error) + func GetActiveDeadlineSeconds(d time.Duration) *int64 + func GetPodSpec(obj client.Object) (corev1.PodSpec, error) + func GetTerminatedContainersStatusesByPod(pod *corev1.Pod) map[string]*corev1.ContainerStateTerminated + func IsBuiltInWorkload(controller *metav1.OwnerReference) bool + func IsClusterScopedKind(kind string) bool + func IsPodControlledByJobNotFound(err error) bool + func IsWorkload(kind string) bool + func KindForObject(object metav1.Object, scheme *runtime.Scheme) (string, error) + func MapContainerNamesToDockerAuths(images ContainerImages, secrets []corev1.Secret) (map[string]docker.Auth, error) + func MapDockerRegistryServersToAuths(imagePullSecrets []corev1.Secret) (map[string]docker.Auth, error) + func NewImagePullSecret(meta metav1.ObjectMeta, server, username, password string) (*corev1.Secret, error) + func NewRunnableJob(scheme *runtime.Scheme, clientset kubernetes.Interface, job *batchv1.Job, ...) runner.Runnable + func ObjectRefToLabels(obj ObjectRef) map[string]string + func ObjectToObjectMeta(obj client.Object, meta *metav1.ObjectMeta) error + type CompatibleMgr interface + GetSupportedObjectByKind func(kind Kind) client.Object + func InitCompatibleMgr(restMapper meta.RESTMapper) (CompatibleMgr, error) + type CompatibleObjectMapper struct + func (o *CompatibleObjectMapper) GetSupportedObjectByKind(kind Kind) client.Object + type ContainerImages map[string]string + func GetContainerImagesFromJob(job *batchv1.Job) (ContainerImages, error) + func GetContainerImagesFromPodSpec(spec corev1.PodSpec) 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 KindNamespace + const KindNetworkPolicy + const KindNode + const KindPod + const KindPodSecurityPolicy + const KindReplicaSet + const KindReplicationController + const KindResourceQuota + const KindRole + const KindRoleBinding + const KindService + const KindStatefulSet + const KindUnknown + 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) GetNodeName(ctx context.Context, obj client.Object) (string, error) + func (o *ObjectResolver) GetPodsByLabelSelector(ctx context.Context, namespace string, labelSelector labels.Set) ([]corev1.Pod, 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 ScannerOpts struct + DeleteScanJob bool + ScanJobTimeout time.Duration + type SecretsReader interface + CredentialsByWorkload func(ctx context.Context, workload client.Object) (map[string]docker.Auth, error) + ListByLocalObjectReferences func(ctx context.Context, refs []corev1.LocalObjectReference, ns string) ([]corev1.Secret, error) + ListByServiceAccount func(ctx context.Context, name string, ns string) ([]corev1.Secret, error) + ListImagePullSecretsByPodSpec func(ctx context.Context, spec corev1.PodSpec, ns string) ([]corev1.Secret, error) + func NewSecretsReader(client client.Client) SecretsReader