Skip to content

Fix validation in the CRD definition #84

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeffgus
Copy link

@jeffgus jeffgus commented May 15, 2025

The validation fails to work when the image string has more than one ":". The validation failed when I tried to pull the marklogic image from an internal registry runnong on port 5000.

@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 21:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the validation logic for the MarkLogic CRD definition so that it correctly handles image strings with more than one ":" by parsing the version from the last colon-separated segment.

  • The validation expression is updated to reference the last element of the image split array.
  • The version extraction now concatenates parts from the final segment of the image string.
Comments suppressed due to low confidence (1)

config/crd/bases/database.marklogic.com_marklogicclusters.yaml:11007

  • [nitpick] Consider refactoring to extract the repeated self.image.split(':') call into a temporary variable or function to improve readability and maintainability of the validation expression.
== true) || int(self.image.split(':')[size(self.image.split(':')) - 1].split('.')[0] + self.image.split(':')[size(self.image.split(':')) - 1].split('.')[1]) 

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.

1 participant