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

opamp bridge configmap: use manifestutils.Labels() logic to set version label #2758

Merged

Conversation

kristinapathak
Copy link
Contributor

Description:

Fixing a bug where the version label for the opamp bridge config map is too long. We had custom logic for the config map that was overriding the version label being set by manifestutils.Labels():

version := strings.Split(image, ":")
for _, v := range version {
if strings.HasSuffix(v, "@sha256") {
versionLabel = strings.TrimSuffix(v, "@sha256")
}
}
switch lenVersion := len(version); lenVersion {
case 3:
base["app.kubernetes.io/version"] = versionLabel
case 2:
base["app.kubernetes.io/version"] = naming.Truncate("%s", 63, version[len(version)-1])
default:
base["app.kubernetes.io/version"] = "latest"
}

I removed the custom logic and added a unit test for this use case.

Link to tracking Issue(s):

Testing:
I refactored the unit tests a bit to include this use case and make the test table driven.

Documentation:
None

@kristinapathak kristinapathak requested a review from a team March 13, 2024 03:03
@kristinapathak kristinapathak changed the title opamp bridge: use manifestutils.Labels() logic to set version label opamp bridge configmap: use manifestutils.Labels() logic to set version label Mar 13, 2024
@kristinapathak kristinapathak force-pushed the opampbridge-version-label branch from 4e92455 to 8cd73c9 Compare March 13, 2024 03:11
Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

LGTM

@jaronoff97 jaronoff97 merged commit 3a3df0b into open-telemetry:main Mar 13, 2024
31 checks passed
@kristinapathak kristinapathak deleted the opampbridge-version-label branch March 13, 2024 21:45
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
…on label (open-telemetry#2758)

* opamp bridge: use manifestutils.Labels() logic to set version label

* changelog entry
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.

Operator errors when opamp bridge image is pinned to a specific sha
4 participants