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

Delete controllers package #270

Merged
merged 14 commits into from
Apr 27, 2020
Merged

Delete controllers package #270

merged 14 commits into from
Apr 27, 2020

Conversation

rbren
Copy link
Contributor

@rbren rbren commented Mar 30, 2020

No description provided.

@CLAassistant
Copy link

CLAassistant commented Mar 30, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ rbren
❌ Robert Brennan


Robert Brennan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

func NewGenericWorkload(originalResource kubeAPICoreV1.Pod, dynamicClientPointer *dynamic.Interface, restMapperPointer *meta.RESTMapper) GenericWorkload {
workload := GenericWorkload{}
workload.Name = originalResource.Name
workload.Namespace = originalResource.Namespace
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baderbuddy I can't figure out why originalResource.Name is defined, based on the godoc

Looks like we're tracking Name and Namespace in addition to ObjectMeta - any thoughts on getting rid of one or the other?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah using ObjectMeta to get at Name and Namespace makes sense. I'm pretty sure the .Name and .Namespace are just shorthand.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I misunderstood your question. Ooh that's a great point. Right now we keep the Pod's Meta no matter what, but the Name matches the top level controller. I could see value in the metadata especially for Annotations, but for the most part I think just the name and Namespace are all we really need.

@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #270 into master will decrease coverage by 0.34%.
The diff coverage is 69.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #270      +/-   ##
==========================================
- Coverage   55.64%   55.29%   -0.35%     
==========================================
  Files          12       12              
  Lines         629      604      -25     
==========================================
- Hits          350      334      -16     
+ Misses        247      237      -10     
- Partials       32       33       +1     
Impacted Files Coverage Δ
pkg/config/config.go 67.74% <ø> (ø)
pkg/kube/workload.go 32.25% <32.25%> (ø)
pkg/kube/resources.go 70.74% <95.45%> (+0.53%) ⬆️
pkg/validator/container.go 72.72% <100.00%> (ø)
pkg/validator/controller.go 81.48% <100.00%> (ø)
pkg/validator/pod.go 63.63% <100.00%> (ø)
pkg/validator/schema.go 79.56% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f559f33...c203cb6. Read the comment docs.

Copy link
Contributor

@baderbuddy baderbuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks so much cleaner. I like it!

@@ -72,13 +72,6 @@ customChecks:
not:
pattern: ^quay.io

controllersToScan:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to leave this to limit the validating webhook?

func NewGenericWorkload(originalResource kubeAPICoreV1.Pod, dynamicClientPointer *dynamic.Interface, restMapperPointer *meta.RESTMapper) GenericWorkload {
workload := GenericWorkload{}
workload.Name = originalResource.Name
workload.Namespace = originalResource.Namespace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I misunderstood your question. Ooh that's a great point. Right now we keep the Pod's Meta no matter what, but the Name matches the top level controller. I could see value in the metadata especially for Annotations, but for the most part I think just the name and Namespace are all we really need.

@rbren rbren merged commit 6792fba into master Apr 27, 2020
@rbren rbren deleted the rb/refactor branch April 27, 2020 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants