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

fix: add default managementState as Removed to allow new components to show up in old DSCs, fixes RHOAIENG-14194 #1293

Draft
wants to merge 1 commit into
base: incubation
Choose a base branch
from

Conversation

dhirajsb
Copy link
Contributor

@dhirajsb dhirajsb commented Oct 9, 2024

Description

Add default managementState as Removed to allow new components to show up in old DSCs
Without the default managementState, K8s apiserver uses an empty component object with unspecified management state. Even though the operator treats that as Removed, it's better to have that specified explicitly as the default value in the CRD.
Fixes RHOAIENG-14194

How Has This Been Tested?

Tested manually by manually removing a component from a CRD, putting it back but with a default managementState value in the CRD.

To test it manually by temporarily removing the modelmeshserving component and adding it back again, try the commands:

# remove component from DSC
oc patch dsc default-dsc --type=json -p='[{"op": "remove", "path": "/spec/components/modelmeshserving"}]'
# verify component is empty
oc get dsc default-dsc -o jsonpath="{.spec.components.modelmeshserving}"
# grab the old component CRD in mm.json
oc get crd datascienceclusters.datasciencecluster.opendatahub.io -o json | jq -r '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.components.properties.modelmeshserving' > mm.json
# remove the component from CRD
oc patch crd datascienceclusters.datasciencecluster.opendatahub.io --type=json -p='[{"op": "remove", "path": "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/components/properties/modelmeshserving"}]'
# try to get the missing component from DSC
oc get dsc default-dsc -o jsonpath="{.spec.components.modelmeshserving}"
# put the component back in the CRD as if it was a new component
oc patch crd datascienceclusters.datasciencecluster.opendatahub.io --type='json' -p='[{"op": "add", "path": "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/components/properties/modelmeshserving", "value": '"$(cat mm.json)"'}]'
# add default value for component managementState
oc patch crd datascienceclusters.datasciencecluster.opendatahub.io --type=json -p='[{"op": "add", "path": "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/components/properties/modelmeshserving/properties/managementState/default", "value": "Removed"}]'
# get the missing component from DSC with expected default managementState
oc get dsc default-dsc -o jsonpath="{.spec.components.modelmeshserving}"

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • 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

Copy link

openshift-ci bot commented Oct 9, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign gzaronikas for approval. For more information see the Kubernetes Code Review Process.

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

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

…o show up in old DSCs, fixes RHOAIENG-14194

Signed-off-by: Dhiraj Bokde <[email protected]>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (incubation@db0fa50). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             incubation    #1293   +/-   ##
=============================================
  Coverage              ?   18.96%           
=============================================
  Files                 ?       30           
  Lines                 ?     2663           
  Branches              ?        0           
=============================================
  Hits                  ?      505           
  Misses                ?     2096           
  Partials              ?       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ykaliuta
Copy link
Contributor

looks ok for me

@dhirajsb
Copy link
Contributor Author

@VaishnaviHire , @zdtsw please approve to include in 2.15 code freeze next week.

@zdtsw
Copy link
Member

zdtsw commented Oct 14, 2024

@VaishnaviHire , @zdtsw please approve to include in 2.15 code freeze next week.

i've made #1300 to only do the change for ModelReg and keep other component as-is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants