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

Fixes using wrong tag for immutable image when version is set #694

Merged
merged 2 commits into from
Apr 7, 2022

Conversation

meik99
Copy link
Contributor

@meik99 meik99 commented Apr 7, 2022

Description

Summary

This PR truncates the build date of a supplied OneAgent version when used as a tag for the immutable image.
It implements the change for the ImmutableOneAgentImage() DynaKube property.

Which issue is fixed

When the OneAgent version is set in the custom resource and the CSI driver is used, the image cannot be pulled since the version has the wrong format for the image.

The CSI driver expects the version to be in a format like "1.231.288.20220218-170442". If the version is not in this format, the CSI driver cannot download it from the API since the version has to include the build date.

However, the same version field is used to overwrite the version tag for the oneagent images that are used. These image tags do not contain the build date.
Therefore, the version can only be correct for either the API or the Image tag.

How can this be tested?

Environment necessary

Fresh Kubernetes cluster

Recreating the error

On a fresh cluster,
create the dynatrace namespace,
deploy the operator from the master branch or use the 0.5 release,
create the dynakube secret,
modify a sample to use cloud native full stack and set the version field to a valid version, e.g., the one described above,
watch the pods fail due to a image pull back off error,
modify the sample to use a version without the build date and apply,
watch the pods be created successfully, however the CSI driver will fail in the logs due to the version being invalid

Confirming the fix

On a fresh cluster,
create the dynatrace namespace,
deploy the operator from fix/truncate-version-build-date branch,
create the dynakube secret,
modify a sample to use cloud native full stack and set the version field to a valid version, e.g., the one described above,
the pods should start successfully, the version tag should be the same as the one in the CR but without the build date,
the CSI driver does not show error logs regarding the version

Checklist

  • Unit tests have been updated/added
  • PR is labeled accordingly

@meik99 meik99 added bug Something isn't working core Changes to core functionality of the Operator labels Apr 7, 2022
@meik99 meik99 requested a review from a team as a code owner April 7, 2022 07:34
@luhi-DT
Copy link
Collaborator

luhi-DT commented Apr 7, 2022

Should we have also an check in the validation webhook, that the version provided has a compatible and correct format?

@meik99
Copy link
Contributor Author

meik99 commented Apr 7, 2022

Should we have also an check in the validation webhook, that the version provided has a compatible and correct format?

We could consider that as an additional feature.
This PR should only fix the already existing bug

@0sewa0 0sewa0 enabled auto-merge (squash) April 7, 2022 09:56
@0sewa0 0sewa0 merged commit f2f4b25 into master Apr 7, 2022
@0sewa0 0sewa0 deleted the fix/truncate-version-build-date branch April 7, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Changes to core functionality of the Operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants