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

Add scale subresource status to the OpenTelemetryCollector CRD status #785

Merged

Conversation

secat
Copy link
Contributor

@secat secat commented Mar 17, 2022

Resolves #775

@secat secat requested a review from a team as a code owner March 17, 2022 13:50
@secat secat force-pushed the 775-add-scale-subresource-status branch from e1c1bd9 to 8d548f3 Compare March 17, 2022 16:01
// +optional
Selector string `json:"selector,omitempty"`
}

// OpenTelemetryCollectorStatus defines the observed state of OpenTelemetryCollector.
type OpenTelemetryCollectorStatus struct {
// Replicas is currently not being set and might be removed in the next version.
// +optional
Replicas int32 `json:"replicas,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be deprecated and eventually removed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, should I remove it in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This status field is currently unused

Copy link
Member

Choose a reason for hiding this comment

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

Right, but I think it's still best to deprecate in one version, removing in another. Even if only to serve as a pattern for future, similar tasks.

Copy link
Member

Choose a reason for hiding this comment

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

This is good, but for reference, we typically add the version it was deprecated, so that we know when it's safe to remove. Like:

 // Deprecated: [v0.47.0] use "OpenTelemetryCollector.Status.Scale.Replicas" instead.

Copy link
Member

@pavolloffay pavolloffay Mar 31, 2022

Choose a reason for hiding this comment

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

As far as I know, properties from the CRD should not be removed. The cleanup can be done only when we promote the CRD to a new version.

@secat secat force-pushed the 775-add-scale-subresource-status branch from 10d667e to 92b01c7 Compare March 17, 2022 17:29
@secat
Copy link
Contributor Author

secat commented Mar 17, 2022

Just updated the bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml file

@secat
Copy link
Contributor Author

secat commented Mar 17, 2022

Fixed also a golang-ci lint error: disabled the exhaustive linter over the switch mode located in the updateScaleSubResourceStatus function

@secat secat requested a review from jpkrohling March 17, 2022 17:46
@pavolloffay
Copy link
Member

@secat please take a look here #775 (comment)

@secat
Copy link
Contributor Author

secat commented Mar 23, 2022

@pavolloffay and @jpkrohling is there anything that needs to be done prior to merge this PR? Thank you in advance! 😃

@jpkrohling
Copy link
Member

This is good to go for me, but given @pavolloffay's comments, it would be good to have an explicit approval from him.

@secat
Copy link
Contributor Author

secat commented Mar 29, 2022

@pavolloffay anything missing in this PR? Thank you in advance

@pavolloffay
Copy link
Member

@secat sorry for the dealy, first I was late on the review due to playing with the HPA and then I got sick.

I think we can merge this but let's discuss one more thing about HPA in #775

@pavolloffay
Copy link
Member

I think this can go in as it is. I would maybe prefer to have the scale fields directly in the status to avoid deprecating status.replicas and inconsistency between status.scale.replicas.

@pavolloffay pavolloffay merged commit c714be0 into open-telemetry:main Apr 5, 2022
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
…open-telemetry#785)

* Add scale subresource status to the OpenTelemetryCollector CRD status

* Deprecate OpenTelemetryCollector.Status.Replicas

* Disable exhaustive linter on updateScaleSubResourceStatus 'switch mode'
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.

Add missing scale subresource status in order to use an HPA resource over an OpenTelemetryCollector CR
3 participants