Skip to content

Refactor envtest mocks & client logic for catalog-source ConfigMap handling#1924

Merged
google-oss-prow[bot] merged 2 commits intokubeflow:mainfrom
ederign:cleanup-refactoring
Nov 26, 2025
Merged

Refactor envtest mocks & client logic for catalog-source ConfigMap handling#1924
google-oss-prow[bot] merged 2 commits intokubeflow:mainfrom
ederign:cleanup-refactoring

Conversation

@ederign
Copy link
Copy Markdown
Member

@ederign ederign commented Nov 25, 2025

Description

This PR is a starting point for refactoring based on my conversations with @ppadti. I left a considerable number of TODOs that will be addressed by @ppadti in a FUP PR.

This change aligns our handling of the model-catalog-default-sources and model-catalog-sources ConfigMaps and aligns our test/mock environment (envtest).

In this PR:

  • Reverted modelCatalogSettingsRepository mock creation to align with your k8s mock strategy
  • Implemented GetAllCatalogSourceConfigs for the default catalog
  • Setup env test for model-catalog-source-config

Next steps:

FUP PR from @ppadti to write the full implementation

How Has This Been Tested?

run the application in mock mode
make dev-start

try these curl commands:

get all source configs:

curl -X GET "http://localhost:4000/api/v1/settings/model_catalog/source_configs?namespace=kubeflow" -H "kubeflow-userid: user@example.com"

add a catalog source config:

curl -X POST "http://localhost:4000/api/v1/settings/model_catalog/source_configs?namespace=kubeflow" -H "kubeflow-userid: user@example.com" -H "Content-Type: application/json" -d '{"data":{"id":"test-catalog","name":"Test Catalog","type":"yaml"}}' 

get a catalog source config:

curl -s "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: user@example.com" 

Update a catalog source config:

curl -X PATCH "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: user@example.com" -H "Content-Type: application/json" -d '{"data":{"id":"test-catalog","name":"Updated Catalog","type":"yaml"}}'

Delete a catalog source config:

curl -X DELETE "http://localhost:4000/api/v1/settings/model_catalog/source_configs/test-catalog?namespace=kubeflow" -H "kubeflow-userid: user@example.com"

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages
  • Automated tests are provided as part of the PR for major new functionalities; 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.
  • Code changes follow the kubeflow contribution guidelines.

…ndling

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
@ederign
Copy link
Copy Markdown
Member Author

ederign commented Nov 25, 2025

/assign @ppadti

@google-oss-prow
Copy link
Copy Markdown
Contributor

@ederign: GitHub didn't allow me to assign the following users: ppadti.

Note that only kubeflow members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

Details

In response to this:

/assign @ppadti

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ederign
Copy link
Copy Markdown
Member Author

ederign commented Nov 25, 2025

/hold

@ederign
Copy link
Copy Markdown
Member Author

ederign commented Nov 25, 2025

Hold until @ppadti does the rest of the refactoring.

…lt and catalog source

Signed-off-by: ppadti <ppadti@redhat.com>
@ederign
Copy link
Copy Markdown
Member Author

ederign commented Nov 26, 2025

/unhold

@ederign
Copy link
Copy Markdown
Member Author

ederign commented Nov 26, 2025

@ppadti, your changes lgtm!

@mturley
Copy link
Copy Markdown
Contributor

mturley commented Nov 26, 2025

/lgtm
/approve

@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mturley

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

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

@google-oss-prow google-oss-prow Bot merged commit 16fb308 into kubeflow:main Nov 26, 2025
34 of 35 checks passed
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.

3 participants