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 sanity check on regex match results while determining runtime image #245

Merged

Conversation

VedantMahabaleshwarkar
Copy link
Contributor

@VedantMahabaleshwarkar VedantMahabaleshwarkar commented Jul 24, 2024

Description

Fixes : https://issues.redhat.com/browse/RHOAIENG-10286

  • Added a sanity check to the regex match array so that the controller does not panic.
    • If the regex match is not what is expected odh-model-controller will end up creating a configmap for unsupported metrics
  • Modified unit tests to cover this case

How Has This Been Tested?

  • Unit test coverage
  • Try to deploy the SR mentioned in the JIRA and verify odh-model-controller doesn't crash

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Signed-off-by: Vedant Mahabaleshwarkar <vmahabal@redhat.com>
@openshift-ci openshift-ci bot requested review from Jooho and spolti July 24, 2024 20:06
Copy link
Contributor

@Jooho Jooho left a comment

Choose a reason for hiding this comment

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

At the moment, it is ok for current situation so I will approve this but the regexp should be improved to cover all possible image URL formats like the following:

		"docker.io/library/ubuntu:latest",
		"myregistry.com/mynamespace/myimage@sha256:abcdef123456",
		"myregistry.com/myimage:latest",
		"myimage@sha256:abcdef123456",
		"myimage:latest",

and need to add unit tests for this.

/lgtm

Copy link
Contributor

openshift-ci bot commented Jul 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jooho, VedantMahabaleshwarkar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Jooho,VedantMahabaleshwarkar]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 7a14b20 into opendatahub-io:main Jul 25, 2024
5 checks passed
VedantMahabaleshwarkar referenced this pull request in VedantMahabaleshwarkar/odh-model-controller Jul 30, 2024
…kar/eng-10286

add sanity check on regex match results while determining runtime image
VedantMahabaleshwarkar referenced this pull request in VedantMahabaleshwarkar/odh-model-controller Jul 30, 2024
…kar/eng-10286

add sanity check on regex match results while determining runtime image
VedantMahabaleshwarkar referenced this pull request in VedantMahabaleshwarkar/odh-model-controller Jul 30, 2024
…kar/eng-10286

add sanity check on regex match results while determining runtime image
VedantMahabaleshwarkar referenced this pull request in VedantMahabaleshwarkar/odh-model-controller Jul 30, 2024
…kar/eng-10286

add sanity check on regex match results while determining runtime image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants