Documentation
¶
Index ¶
- Variables
- func CalculateResourceDifference(usedResourceNames []string, allResourceNames []string) []string
- func CheckFinalizers(finalizers []string, deletionTimestamp *metav1.Time) bool
- func CreateEphemeralVolumeDefinition(name, size string) *corev1.Volume
- func CreatePersistentVolumeClaimVolumeSource(name string) *corev1.PersistentVolumeClaimVolumeSource
- func CreateTestCSIDriver(name string) *storagev1.CSIDriver
- func CreateTestClusterRole(name string, labels map[string]string, matchLabels ...v1.LabelSelector) *rbacv1.ClusterRole
- func CreateTestClusterRoleBinding(namespace, name, serviceAccountName string) *rbacv1.ClusterRoleBinding
- func CreateTestClusterRoleBindingRoleRef(namespace, name, serviceAccountName string, roleRefName *rbacv1.RoleRef) *rbacv1.ClusterRoleBinding
- func CreateTestConfigmap(namespace, name string, labels map[string]string) *corev1.ConfigMap
- func CreateTestDaemonSet(namespace, name string, labels map[string]string, ...) *appsv1.DaemonSet
- func CreateTestDeployment(namespace, name string, replicas int32, labels map[string]string) *appsv1.Deployment
- func CreateTestEndpoint(namespace, name string, endpointCount int, labels map[string]string) *discoveryv1.EndpointSlice
- func CreateTestHpa(namespace, name, deploymentName string, minReplicas, maxReplicas int32, ...) *autoscalingv2.HorizontalPodAutoscaler
- func CreateTestIngress(namespace, name, ServiceName, secretName string, labels map[string]string) *networkingv1.Ingress
- func CreateTestJob(namespace, name string, status *batchv1.JobStatus, labels map[string]string) *batchv1.Job
- func CreateTestNetworkPolicy(name, namespace string, labels map[string]string, podSelector v1.LabelSelector, ...) *networkingv1.NetworkPolicy
- func CreateTestNode(name string) *corev1.Node
- func CreateTestPdb(namespace, name string, matchLabels, pdbLabels map[string]string) *policyv1.PodDisruptionBudget
- func CreateTestPod(namespace, name, serviceAccountName string, volumes []corev1.Volume, ...) *corev1.Pod
- func CreateTestPv(name, phase string, labels map[string]string, storageClass string) *corev1.PersistentVolume
- func CreateTestPvc(namespace, name string, labels map[string]string, storageClass string) *corev1.PersistentVolumeClaim
- func CreateTestRbacSubject(namespace, serviceAccountName string) *rbacv1.Subject
- func CreateTestReplicaSet(namespace, name string, specReplicas *int32, status *appsv1.ReplicaSetStatus) *appsv1.ReplicaSet
- func CreateTestRole(namespace, name string, labels map[string]string) *rbacv1.Role
- func CreateTestRoleBinding(namespace, name, serviceAccountName string, roleRefName *rbacv1.RoleRef) *rbacv1.RoleBinding
- func CreateTestRoleRef(roleName string) *rbacv1.RoleRef
- func CreateTestRoleRefForClusterRole(roleName string) *rbacv1.RoleRef
- func CreateTestSecret(namespace, name string, labels map[string]string) *corev1.Secret
- func CreateTestService(namespace, name string) *corev1.Service
- func CreateTestServiceAccount(namespace, name string, labels map[string]string) *corev1.ServiceAccount
- func CreateTestStatefulSet(namespace, name string, replicas int32, labels map[string]string) *appsv1.StatefulSet
- func CreateTestStorageClass(name, provisioner string) *storagev1.StorageClass
- func CreateTestUnstructered(kind, apiVersion, namespace, name string) *unstructured.Unstructured
- func CreateTestVolume(name, pvcName string) *corev1.Volume
- func CreateTestVolumeAttachment(name, attacher, nodeName, pvName string) *storagev1.VolumeAttachment
- func DeleteResourceCmd() map[string]func(clientset kubernetes.Interface, namespace, name string) error
- func Exporter(filterOptions *filters.Options, clientset kubernetes.Interface, ...)
- func FlagDynamicResource(dynamicClient dynamic.Interface, namespace string, ...) error
- func FlagResource(clientset kubernetes.Interface, namespace, resourceType, resourceName string) error
- func FormatOutput(resources map[string]map[string][]ResourceInfo, opts common.Opts) bytes.Buffer
- func FormatOutputAll(namespace string, allDiffs []ResourceDiff, opts common.Opts) string
- func GetAPIExtensionsClient(kubeconfig string) *apiextensionsclientset.Clientset
- func GetConfig(kubeconfig string) (*rest.Config, error)
- func GetDynamicClient(kubeconfig string) *dynamic.DynamicClient
- func GetKubeClient(kubeconfig string) *kubernetes.Clientset
- func GetKubeConfigPath() string
- func GetResourceKinds(clientset kubernetes.Interface) (map[string]ResourceKind, error)
- func GetUnusedAll(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedAllNamespaced(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedAllNonNamespaced(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedClusterRoles(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedConfigmaps(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedCrds(_ *filters.Options, apiExtClient apiextensionsclientset.Interface, ...) (string, error)
- func GetUnusedDaemonSets(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedDeployments(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedHpas(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedIngresses(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedJobs(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedMulti(resourceNames string, filterOpts *filters.Options, ...) (string, error)
- func GetUnusedNetworkPolicies(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedPdbs(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedPods(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedPvcs(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedPvs(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedReplicaSets(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedRoleBindings(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedRoles(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedSecrets(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedServiceAccounts(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedServices(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedStatefulSets(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedStorageClasses(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedVolumeAttachments(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func GetUnusedfinalizers(filterOpts *filters.Options, clientset kubernetes.Interface, ...) (string, error)
- func RemoveDuplicatesAndSort(slice []string) []string
- func SetNamespacedFlagState(isFlagUsed bool)
- type Config
- type ExceptionResource
- type GetUnusedResourceJSONResponse
- type IncludeExcludeLists
- type ResourceDiff
- type ResourceInfo
- type ResourceKind
Constants ¶
This section is empty.
Variables ¶
View Source
var AppLabels = map[string]string{}
View Source
var NamespacedFlagUsed bool
View Source
var ResourceKindList map[string]ResourceKind
View Source
var UnusedLabels = map[string]string{"kor/used": "false"}
View Source
var UsedLabels = map[string]string{"kor/used": "true"}
Functions ¶
func CalculateResourceDifference ¶ added in v0.1.9
TODO create formatter by resource "#", "Resource Name", "Namespace" TODO Functions that use this object are accompanied by repeated data acquisition operations and can be optimized.
func CheckFinalizers ¶ added in v0.3.3
func CreateEphemeralVolumeDefinition ¶ added in v0.5.9
func CreatePersistentVolumeClaimVolumeSource ¶ added in v0.2.3
func CreatePersistentVolumeClaimVolumeSource(name string) *corev1.PersistentVolumeClaimVolumeSource
func CreateTestCSIDriver ¶ added in v0.6.0
func CreateTestClusterRole ¶ added in v0.3.5
func CreateTestClusterRole(name string, labels map[string]string, matchLabels ...v1.LabelSelector) *rbacv1.ClusterRole
func CreateTestClusterRoleBinding ¶ added in v0.2.3
func CreateTestClusterRoleBinding(namespace, name, serviceAccountName string) *rbacv1.ClusterRoleBinding
func CreateTestClusterRoleBindingRoleRef ¶ added in v0.3.5
func CreateTestClusterRoleBindingRoleRef(namespace, name, serviceAccountName string, roleRefName *rbacv1.RoleRef) *rbacv1.ClusterRoleBinding
func CreateTestConfigmap ¶ added in v0.2.3
func CreateTestDaemonSet ¶ added in v0.3.5
func CreateTestDeployment ¶ added in v0.2.3
func CreateTestEndpoint ¶ added in v0.2.3
func CreateTestEndpoint(namespace, name string, endpointCount int, labels map[string]string) *discoveryv1.EndpointSlice
func CreateTestHpa ¶ added in v0.2.3
func CreateTestHpa(namespace, name, deploymentName string, minReplicas, maxReplicas int32, labels map[string]string) *autoscalingv2.HorizontalPodAutoscaler
func CreateTestIngress ¶ added in v0.2.3
func CreateTestIngress(namespace, name, ServiceName, secretName string, labels map[string]string) *networkingv1.Ingress
func CreateTestJob ¶ added in v0.3.2
func CreateTestNetworkPolicy ¶ added in v0.5.0
func CreateTestNetworkPolicy(name, namespace string, labels map[string]string, podSelector v1.LabelSelector, ingress []networkingv1.NetworkPolicyIngressRule, egress []networkingv1.NetworkPolicyEgressRule) *networkingv1.NetworkPolicy
func CreateTestNode ¶ added in v0.6.0
func CreateTestPdb ¶ added in v0.2.3
func CreateTestPdb(namespace, name string, matchLabels, pdbLabels map[string]string) *policyv1.PodDisruptionBudget
func CreateTestPod ¶ added in v0.2.3
func CreateTestPv ¶ added in v0.3.1
func CreateTestPvc ¶ added in v0.2.3
func CreateTestRbacSubject ¶ added in v0.2.3
func CreateTestReplicaSet ¶ added in v0.3.3
func CreateTestReplicaSet(namespace, name string, specReplicas *int32, status *appsv1.ReplicaSetStatus) *appsv1.ReplicaSet
func CreateTestRole ¶ added in v0.2.3
func CreateTestRoleBinding ¶ added in v0.2.3
func CreateTestRoleBinding(namespace, name, serviceAccountName string, roleRefName *rbacv1.RoleRef) *rbacv1.RoleBinding
func CreateTestRoleRef ¶ added in v0.2.3
func CreateTestRoleRefForClusterRole ¶ added in v0.3.5
func CreateTestSecret ¶ added in v0.2.3
func CreateTestService ¶ added in v0.2.3
func CreateTestServiceAccount ¶ added in v0.2.3
func CreateTestServiceAccount(namespace, name string, labels map[string]string) *corev1.ServiceAccount
func CreateTestStatefulSet ¶ added in v0.2.3
func CreateTestStorageClass ¶ added in v0.3.7
func CreateTestStorageClass(name, provisioner string) *storagev1.StorageClass
func CreateTestUnstructered ¶ added in v0.3.6
func CreateTestUnstructered(kind, apiVersion, namespace, name string) *unstructured.Unstructured
func CreateTestVolume ¶ added in v0.2.3
func CreateTestVolumeAttachment ¶ added in v0.6.0
func CreateTestVolumeAttachment(name, attacher, nodeName, pvName string) *storagev1.VolumeAttachment
func DeleteResourceCmd ¶ added in v0.2.7
func DeleteResourceCmd() map[string]func(clientset kubernetes.Interface, namespace, name string) error
func Exporter ¶ added in v0.2.4
func Exporter(filterOptions *filters.Options, clientset kubernetes.Interface, apiExtClient apiextensionsclientset.Interface, dynamicClient dynamic.Interface, outputFormat string, opts common.Opts, resourceList []string)
TODO: add option to change port / url !?
func FlagDynamicResource ¶ added in v0.3.3
func FlagResource ¶ added in v0.3.0
func FlagResource(clientset kubernetes.Interface, namespace, resourceType, resourceName string) error
func FormatOutput ¶
func FormatOutputAll ¶
func FormatOutputAll(namespace string, allDiffs []ResourceDiff, opts common.Opts) string
func GetAPIExtensionsClient ¶ added in v0.2.8
func GetAPIExtensionsClient(kubeconfig string) *apiextensionsclientset.Clientset
func GetDynamicClient ¶ added in v0.2.8
func GetDynamicClient(kubeconfig string) *dynamic.DynamicClient
func GetKubeClient ¶
func GetKubeClient(kubeconfig string) *kubernetes.Clientset
func GetKubeConfigPath ¶
func GetKubeConfigPath() string
func GetResourceKinds ¶ added in v0.6.2
func GetResourceKinds(clientset kubernetes.Interface) (map[string]ResourceKind, error)
func GetUnusedAll ¶
func GetUnusedAllNamespaced ¶ added in v0.3.7
func GetUnusedAllNonNamespaced ¶ added in v0.3.7
func GetUnusedClusterRoles ¶ added in v0.3.5
func GetUnusedConfigmaps ¶
func GetUnusedCrds ¶ added in v0.2.8
func GetUnusedDaemonSets ¶ added in v0.3.5
func GetUnusedDeployments ¶ added in v0.1.8
func GetUnusedHpas ¶ added in v0.1.8
func GetUnusedIngresses ¶ added in v0.1.9
func GetUnusedJobs ¶ added in v0.3.2
func GetUnusedMulti ¶ added in v0.2.1
func GetUnusedNetworkPolicies ¶ added in v0.5.0
func GetUnusedPdbs ¶ added in v0.2.0
func GetUnusedPods ¶ added in v0.3.2
func GetUnusedPvcs ¶ added in v0.1.9
func GetUnusedPvs ¶ added in v0.3.1
func GetUnusedReplicaSets ¶ added in v0.3.3
func GetUnusedRoleBindings ¶ added in v0.5.6
func GetUnusedRoles ¶ added in v0.1.8
func GetUnusedSecrets ¶
func GetUnusedServices ¶
func GetUnusedStatefulSets ¶ added in v0.2.3
func GetUnusedStorageClasses ¶ added in v0.3.7
func GetUnusedVolumeAttachments ¶ added in v0.6.0
func GetUnusedfinalizers ¶ added in v0.3.3
func RemoveDuplicatesAndSort ¶
func SetNamespacedFlagState ¶ added in v0.6.0
func SetNamespacedFlagState(isFlagUsed bool)
Types ¶
type Config ¶ added in v0.4.0
type Config struct {
ExceptionClusterRoles []ExceptionResource `json:"exceptionClusterRoles"`
ExceptionConfigMaps []ExceptionResource `json:"exceptionConfigMaps"`
ExceptionCrds []ExceptionResource `json:"exceptionCrds"`
ExceptionDaemonSets []ExceptionResource `json:"exceptionDaemonSets"`
ExceptionRoles []ExceptionResource `json:"exceptionRoles"`
ExceptionSecrets []ExceptionResource `json:"exceptionSecrets"`
ExceptionServiceAccounts []ExceptionResource `json:"exceptionServiceAccounts"`
ExceptionServices []ExceptionResource `json:"exceptionServices"`
ExceptionStorageClasses []ExceptionResource `json:"exceptionStorageClasses"`
ExceptionJobs []ExceptionResource `json:"exceptionJobs"`
ExceptionPdbs []ExceptionResource `json:"exceptionPdbs"`
ExceptionRoleBindings []ExceptionResource `json:"exceptionRoleBindings"`
}
type ExceptionResource ¶
type GetUnusedResourceJSONResponse ¶ added in v0.1.8
type IncludeExcludeLists ¶ added in v0.2.0
type ResourceDiff ¶
type ResourceDiff struct {
// contains filtered or unexported fields
}
type ResourceInfo ¶ added in v0.5.0
func DeleteResource ¶ added in v0.2.7
func DeleteResource(diff []ResourceInfo, clientset kubernetes.Interface, namespace, resourceType string, noInteractive bool) ([]ResourceInfo, error)
func DeleteResourceWithFinalizer ¶ added in v0.3.3
func DeleteResourceWithFinalizer(resources []ResourceInfo, dynamicClient dynamic.Interface, namespace string, gvr schema.GroupVersionResource, noInteractive bool) ([]ResourceInfo, error)
type ResourceKind ¶ added in v0.6.2
Source Files
¶
- all.go
- clusterroles.go
- configmaps.go
- crds.go
- create_test_resources.go
- daemonsets.go
- delete.go
- deployments.go
- exporter.go
- finalizers.go
- formatter.go
- hpas.go
- ingresses.go
- init.go
- jobs.go
- kor.go
- multi.go
- networkpolicies.go
- pdbs.go
- pods.go
- pv.go
- pvc.go
- replicaset.go
- rolebindings.go
- roles.go
- secrets.go
- serviceaccounts.go
- services.go
- statefulsets.go
- storageclasses.go
- volumeattachments.go
Click to show internal directories.
Click to hide internal directories.