-
Notifications
You must be signed in to change notification settings - Fork 605
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
Bug 1760836: Deploy image ignores target port drop down selection and always uses first entry #2868
Bug 1760836: Deploy image ignores target port drop down selection and always uses first entry #2868
Conversation
/test e2e-aws-console-olm |
/assign @rohitkrai03 |
import { createService, createRoute } from '../shared-submit-utils'; | ||
import { GitImportFormData, DeployImageFormData } from '../../components/import/import-types'; | ||
|
||
describe('Shared submit utils', () => { |
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.
Probably worth creating some snapshot tests here so that the entire output can be tested fully.
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.
Done.
@divyanshiGupta do you have any sample image to test which would have multiple ports exposed? |
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.
I have verified locally and seems to work as expected.
const mockData: GitImportFormData = _.cloneDeep(mockFormData); | ||
const mockDeployImageData: DeployImageFormData = _.cloneDeep(mockDeployImageFormData); | ||
const PORT1 = { containerPort: 8081, protocol: 'TCP' }; | ||
let serviceObj; |
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.
do we know type
of serviceObj? i think K8sResourceKind
should work
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.
So in K8sResourceKind
podLabels
is of type Selector
but from getPodLabels
we are returning a simple object with the required label values and not a Selector
object. Hence if I assign K8sResourceKind
it gives error. I tried to add a Selector
Object with the required label values but while submitting the form it showed some error. That is why I have added any for now in the submit methods also for the resource object.
it('should set correct target port in route object', () => { | ||
const mockData: GitImportFormData = _.cloneDeep(mockFormData); | ||
const mockDeployImageData: DeployImageFormData = _.cloneDeep(mockDeployImageFormData); | ||
let routeObj; |
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.
same as above
@@ -62,6 +62,7 @@ const ImageSearch: React.FC = () => { | |||
setFieldValue('isi.status', status); | |||
setFieldValue('isi.ports', ports); | |||
setFieldValue('image.ports', ports); | |||
setFieldValue('image.tag', tag); |
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.
Any specific reason for passing tags fetched from imagestream to image.tag
here, can we use isi tag only for labels in create service/routes.
Ideally, both would be same but it would be good to have them separate isi tag would be one generated as part of imageStream and image tag would be one provided by user( we may need this later as of now we are not fetching user entered tags)
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.
If you see the code of shared submit utils, I have made it usable for both forms. So there are some properties of git import form data that are not available in deploy image form data and vice versa, for such properties I am using get
. Before I did, if image
exists in form data then its tag will be used otherwise isi.tag
will be used, but since image
is present in both the form data this was not the right way to get the tag because if we are on deploy image form in this case tag will always be empty since we are not setting image.tag
anywhere. That is why I had to set it. This image
and isi
thing needs to be refactored. I planned to do it in this PR but it turned out that it will need some investigation to refactor it and not break the code anywhere else as both are being used at different places.
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, divyanshiGupta, invincibleJai 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:
Approvers can indicate their approval by writing |
/retitle Bug 1760836: Deploy image ignores target port drop down selection and always uses first entry |
/bugzilla refresh |
@divyanshiGupta: All pull requests linked via external trackers have merged. Bugzilla bug 1760836 has been moved to the MODIFIED state. In response to this:
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. |
@christianvogt: Bugzilla bug 1760836 is in an unrecognized state (MODIFIED) and will not be moved to the MODIFIED state. In response to this:
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. |
Jira Issue - https://jira.coreos.com/browse/ODC-1911
Refactored
import-submit-utis
anddeployImage-submit-utils
resources
todeploymentConfig
increateDeploymentConfig
ofdeployImage-submit-utils
To Do-
shared-submit-utils