Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce amount of code in pkg/k8sutil package #137

Open
invidian opened this issue Feb 17, 2022 · 0 comments
Open

Reduce amount of code in pkg/k8sutil package #137

invidian opened this issue Feb 17, 2022 · 0 comments

Comments

@invidian
Copy link
Member

Generally util packages are considered a smell and from what I see, there is actually plenty of code which could be moved around to either operator or agent package, so long we can keep it testable.

$ git grep k8sutil\\. | cut -d '(' -f1 | perl -ne '/(.*\/.*\/).*\.go:.*(k8sutil\..*)/ && print "$1 $2\n";' | sort -u | column -t
cmd/update-agent/     k8sutil.GetClient
cmd/update-operator/  k8sutil.GetClient
pkg/agent/            k8sutil.FilterPods
pkg/agent/            k8sutil.GetNodeRetry
pkg/agent/            k8sutil.GetPodsForDeletion
pkg/agent/            k8sutil.SetNodeAnnotations
pkg/agent/            k8sutil.SetNodeAnnotationsLabels
pkg/agent/            k8sutil.SetNodeLabels
pkg/agent/            k8sutil.Unschedulable
pkg/k8sutil/          k8sutil.UpdateNodeRetry
pkg/operator/         k8sutil.FilterContainerLinuxNodes
pkg/operator/         k8sutil.FilterNodesByAnnotation
pkg/operator/         k8sutil.FilterNodesByRequirement
pkg/operator/         k8sutil.NewRequirementOrDie
pkg/operator/         k8sutil.SetNodeLabels
pkg/operator/         k8sutil.UpdateNodeRetry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant