-
Notifications
You must be signed in to change notification settings - Fork 156
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
Implement adding config hash annotation to deployments #5418
Conversation
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]>
// that are referenced by the workload. | ||
// This appending ensures that the workload should be restarted when | ||
// one of its configurations changed. | ||
func annotateConfigHash(manifests []provider.Manifest) error { |
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.
I almost copied from below.
func annotateConfigHash(manifests []provider.Manifest) error { |
"github.com/pipe-cd/pipecd/pkg/app/pipedv1/plugin/kubernetes/provider" | ||
) | ||
|
||
func TestAnnotateConfigHash(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.
I almost copied from below and added a testcase for Secrets
func TestAnnotateConfigHash(t *testing.T) { |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5418 +/- ##
==========================================
+ Coverage 25.90% 25.95% +0.04%
==========================================
Files 450 451 +1
Lines 48565 48731 +166
==========================================
+ Hits 12582 12649 +67
- Misses 34994 35081 +87
- Partials 989 1001 +12 ☔ View full report in Codecov by Sentry. |
@@ -90,6 +90,16 @@ func MakeResourceKey(obj *unstructured.Unstructured) ResourceKey { | |||
return k | |||
} | |||
|
|||
func (k ResourceKey) IsDeployment() bool { |
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.
Could you add test for this 👀
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
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.
Let's go 🚀
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.
👍
What this PR does:
Implement
annotateConfigHash
to use Kubernetes syncWhy we need it:
We add this annotation to ensure that the workload should be restarted when one of its configurations changes.
Which issue(s) this PR fixes:
Part of #4980
Does this PR introduce a user-facing change?: