-
Notifications
You must be signed in to change notification settings - Fork 39
Adding GetImageStatus API to mbsc package #1045
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
Adding GetImageStatus API to mbsc package #1045
Conversation
This API return the status of the an image in the MBSC object based on the image and the action. Is required by the MBSC controller
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yevgeny-shnaidman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @ybettan |
✅ Deploy Preview for kubernetes-sigs-kmm ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1045 +/- ##
==========================================
- Coverage 79.09% 74.40% -4.70%
==========================================
Files 51 76 +25
Lines 5109 6711 +1602
==========================================
+ Hits 4041 4993 +952
- Misses 882 1510 +628
- Partials 186 208 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| func (m *mbsc) GetImageStatus(mbscObj *kmmv1beta1.ModuleBuildSignConfig, image string, action kmmv1beta1.BuildOrSignAction) kmmv1beta1.BuildOrSignStatus { | ||
| for _, imageState := range mbscObj.Status.Images { | ||
| if imageState.Image == image && imageState.Action == action { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to pass the action to get the status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to make sure that we get the correct one. MIC is sending request for image and action, if we don't pass action, we might get the status for the previous action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me why don't we just update the whole status atomically, and remove the imageState.status if we just changed the action and the status wasn't reported yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the status is updated atomically by MBSC controller, but it is updated once the MBSC controller has the result. MIC should never update the status of MBSC object.
|
/lgtm |
This API return the status of the an image in the MBSC object based on the image and the action. Is required by the MBSC controller