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

bug: remove apply logic for better performance #818

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

ibuildthecloud
Copy link
Contributor

No description provided.

existingFile, ok := existingNames[newName]
if !ok {
if err := c.Create(ctx, &newFile); apierror.IsAlreadyExists(err) {
if err := c.Get(ctx, kclient.ObjectKeyFromObject(&existingFile), &existingFile); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if there is a conflict, existingFile will be empty and this will return error to fail the sync.

should be kclient.ObjectKeyFromObject(&newFile)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me look

Copy link
Contributor Author

Choose a reason for hiding this comment

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

youre right, good catch

@cjellick cjellick merged commit 60ff87a into obot-platform:main Dec 7, 2024
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.

3 participants