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

Set default value for version label when custom image is used #843

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Jun 21, 2022

Description

When setting the version label for components managed by the operator (oneagent and activegate) the latest version on the cluster is used instead of the tag of the image in case an image is used.

Now when an image is used for activegate or oneagent, we use its tag as value for the app.kubernetes.io/version label.

To not to confuse the customer when using custom image, the version label is set to a default value of custom-image.
Using the image tag is not reliable/safe (it can be longer then the max label value)

How can this be tested?

Deploy a dynakube where the oneagent/activegate image field is set, and see that the deployed daemonset/statefulset has the correct labels

Checklist

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

@0sewa0 0sewa0 added the core Changes to core functionality of the Operator label Jun 21, 2022
@0sewa0 0sewa0 requested a review from a team as a code owner June 21, 2022 13:17
Copy link
Contributor

@meik99 meik99 left a comment

Choose a reason for hiding this comment

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

I am just nitpicking, you can ignore my comments or commit the suggestions as they are only concerning white-space. I will now continue to test, but it lgtm

Copy link
Contributor

@meik99 meik99 left a comment

Choose a reason for hiding this comment

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

An image is apparently not a valid label value

{"error":"StatefulSet.apps \"dynakube-activegate\" is invalid: [metadata.labels: Invalid value: \"API_URL/linux/activegate:latest\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

@0sewa0 0sewa0 requested a review from meik99 June 22, 2022 09:51
src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
@0sewa0 0sewa0 requested a review from meik99 June 23, 2022 09:55
src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
Copy link
Contributor

@meik99 meik99 left a comment

Choose a reason for hiding this comment

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

just a few more minor things, otherwise looks good

src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
src/api/v1beta1/properties.go Outdated Show resolved Hide resolved
@0sewa0 0sewa0 changed the title Uses image for version label for deployed components (if set) Removes version label when custom image is used Jul 12, 2022
@0sewa0 0sewa0 requested review from mjgrzybek and meik99 July 12, 2022 09:34
@0sewa0 0sewa0 changed the title Removes version label when custom image is used Set default value for version label when custom image is used Jul 12, 2022
@0sewa0 0sewa0 enabled auto-merge (squash) July 14, 2022 08:25
@0sewa0 0sewa0 merged commit 65145f1 into master Jul 14, 2022
@0sewa0 0sewa0 deleted the fix/use-image-for-label branch July 14, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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