-
Notifications
You must be signed in to change notification settings - Fork 155
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
Make k8s plugin fields private #5441
Conversation
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
because it does not treat either the workloads are changed or not Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5441 +/- ##
=======================================
Coverage 26.24% 26.24%
=======================================
Files 452 452
Lines 48860 48864 +4
=======================================
+ Hits 12821 12823 +2
- Misses 35014 35016 +2
Partials 1025 1025 ☔ View full report in Codecov by Sentry. |
} | ||
got := findWorkloadManifests(manifests, tt.refs) | ||
assert.ElementsMatch(t, tt.want, got) | ||
}) | ||
} | ||
} | ||
|
||
func TestFindUpdatedWorkloads(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are moved to the provider package.
{ | ||
name: "manifest with non-string image field", | ||
manifests: []string{ | ||
` | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: non-string-image-deployment | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: 12345 | ||
`, | ||
}, | ||
want: nil, | ||
wantErr: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is an irregular case, and it's not critical. So I removed it.
{ | ||
name: "manifest with invalid containers field -- returns error", | ||
manifests: []string{ | ||
` | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: no-containers-deployment | ||
spec: | ||
template: | ||
spec: | ||
containers: "invalid-containers-field" | ||
`, | ||
}, | ||
wantErr: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is an irregular case, and it's not critical. So I removed it.
key ResourceKey | ||
body *unstructured.Unstructured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I want to do.
apiVersion string | ||
kind string | ||
namespace string | ||
name string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also what I want to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does:
findUpdatedWorkloads
andfindConfigsAndSecrets
to provider packagefindUpdatedWorkloads
toFindSameManifests
because this function does not see whether the manifests are updated or not.provider.FindContainerImages
and use it indetermineVersions
determineVersions
from provider.Manifest.BodyWhy we need it:
To restrict updates of field values.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: