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

not send the spec in UpdateStatus #1506

Merged
merged 1 commit into from
Mar 15, 2023
Merged

Conversation

pjuarezd
Copy link
Member

@pjuarezd pjuarezd commented Mar 15, 2023

cheers to @dvaldivia

Partially fixes #1388, the error logs on Console are shown because we (somehow) included the creationTimestamp field under volumeClaimTemplates fields, no more!

1 warnings.go:70] unknown field "spec.pools[0].volumeClaimTemplate.metadata.creationTimestamp"

dvaldivia
dvaldivia previously approved these changes Mar 15, 2023
@dvaldivia
Copy link
Collaborator

What an elegant solution 🧐

@dvaldivia
Copy link
Collaborator

elegance-spy-x-family

@pjuarezd pjuarezd changed the title by not sending the spec field in UpdateStatus not send the spec in UpdateStatus Mar 15, 2023
@@ -39,6 +39,7 @@ func (c *Controller) updateTenantStatusWithRetry(ctx context.Context, tenant *mi
// You can use DeepCopy() to make a deep copy of original object and modify this copy
// Or create a copy manually for better performance
tenantCopy := tenant.DeepCopy()
tenantCopy.Spec = miniov2.TenantSpec{}
Copy link
Contributor

Choose a reason for hiding this comment

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

would nil work or do we need an instance of TenantSpec later in the code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think nil will not work, cannot assign nil to a field of type TenantSpec (Tenant.Spec).
but yeah, we don't need Spec later in the code, that is why we are reseting it's value, c.minioClientSet.MinioV2().Tenants(tenant.Namespace).UpdateStatus(ctx, tenantCopy, opts) only needs the values in the Tenant.Status struct and ignores all of the other values in the Tenant.Spec struct.

@dvaldivia dvaldivia merged commit 0b748d9 into minio:master Mar 15, 2023
@pjuarezd pjuarezd deleted the no-error-messages branch March 16, 2023 05:10
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.

kubectl minio tenant create --output's YAML is invalid
3 participants