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

Refactor label removal to use DeleteLabelObject function #1931

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

yunkon-kim
Copy link
Member

@yunkon-kim yunkon-kim commented Nov 18, 2024

This PR will mainly replace RemoveLabel() with DeleteLabelObject(). It's related to the last part of resource deletion functions.

@seokho-son

Could you please double-check whether the DeleteLabelObject() function is appropriate for the resource deletion function?

Which do you prefer between error or nil for the return value when the label object doesn't exist in RemoveLabel()?

close #1928

@seokho-son
Copy link
Member

@yunkon-kim I think the DeleteLabelObject() function itself should return an error.

However, when using it, the function that calls DeleteLabelObject() can decide whether to propagate the error to its caller or not.

If the process involves important and time-consuming tasks, an error from deleting a label might be considered somewhat negligible.

@yunkon-kim
Copy link
Member Author

yunkon-kim commented Nov 19, 2024

(Sharing offline discussion)

  1. DeleteLabelObject() is suitable when deleting a resource.
  2. If labelObject is fetched in RemoveLabel() but there is no value, return an error and process it in the upper function.

There seems to be nothing to update :-)

@yunkon-kim
Copy link
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Nov 19, 2024
@cb-github-robot cb-github-robot merged commit bc68877 into cloud-barista:main Nov 19, 2024
5 checks passed
@yunkon-kim yunkon-kim deleted the 241118-20 branch November 19, 2024 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved and will be merged soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I got an error 'unexpected end of JSON input
3 participants