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

Remove checking the resource key with the annotation because their generation logic are different #4891

Closed

Conversation

ffjlabo
Copy link
Member

@ffjlabo ffjlabo commented Apr 22, 2024

What this PR does / why we need it:

context: #4269 (comment)

Removed checking the resource key with the annotation because their generation logic differs.

Previously, I tried to keep using the annotation pipecd.dev/resource-key, but found that some k8s resources inherit the parent's annotation and can't be attached correct resource key.
ref: #4858 (comment)

So I decided to remove the checking.

Which issue(s) this PR fixes:

Part of #4269
Previous PR #4858

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

…neration logic are different

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 29.25%. Comparing base (42371a0) to head (92164f2).

Files Patch % Lines
...g/app/piped/platformprovider/kubernetes/applier.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4891   +/-   ##
=======================================
  Coverage   29.24%   29.25%           
=======================================
  Files         318      318           
  Lines       40597    40593    -4     
=======================================
  Hits        11874    11874           
+ Misses      27784    27780    -4     
  Partials      939      939           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ffjlabo
Copy link
Member Author

ffjlabo commented Apr 22, 2024

I checked the prune behavior like below.

cluster scoped resource

  • ✅ namespace exists in app.pipecd.yaml 
  • ✅ namespace doesn't exist in app.pipecd.yaml

namespace scoped resource

  • ✅ namespace exists in app.pipecd.yaml 
  • ✅ namespace doesn't exist in app.pipecd.yaml

@ffjlabo
Copy link
Member Author

ffjlabo commented Apr 22, 2024

There is a problem about the resource key of cluster scoped resources. I'll consider it later to modify the effect scope.

@@ -147,21 +146,17 @@ func (a *applier) Delete(ctx context.Context, k ResourceKey) (err error) {
return a.initErr
}

m, err := a.kubectl.Get(
// Check the resource exists or not using the resource key.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Check the resource exists or not using the resource key.
// Check whether the resource exists or not using the resource key.

@ffjlabo
Copy link
Member Author

ffjlabo commented May 22, 2024

close this PR because I decided another solution for it.
context: #4269 (comment)
follow the PR → #4916

@ffjlabo ffjlabo closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants