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

windows path seperator fix #4234

Conversation

anandrkskd
Copy link
Contributor

@anandrkskd anandrkskd commented Nov 17, 2020

Signed-off-by: anandrkskd anandrkskd@gmail.com

What type of PR is this?

/kind bug

What does does this PR do / why we need it:

This PR will Fix image source for E2E test image.

Which issue(s) this PR fixes:

Fixes #3389
Fixes #4235

PR acceptance criteria:

How to test changes / Special notes to the reviewer:

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
@anandrkskd anandrkskd added the kind/bug Categorizes issue or PR as related to a bug. label Nov 17, 2020
@prietyc123
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Nov 18, 2020
@@ -89,35 +89,35 @@ var _ = Describe("odo supported images e2e tests", func() {
})

It("Should be able to verify the nodejs-10 image", func() {
oc.ImportImageFromRegistry("registry.access.redhat.com", filepath.Join("rhoar-nodejs", "nodejs-10:latest"), "nodejs:latest", commonVar.Project)
verifySupportedImage(filepath.Join("rhoar-nodejs", "nodejs-10:latest"), "nodejs", "nodejs:latest", commonVar.Project, appName, commonVar.Context)
oc.ImportImageFromRegistry("registry.access.redhat.com", filepath.ToSlash(filepath.Join("rhoar-nodejs", "nodejs-10:latest")), "nodejs:latest", commonVar.Project)
Copy link
Member

Choose a reason for hiding this comment

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

You should not treat this as a file path. This is what got us into this situation in the first place.
Your solution would technically work, but it is still wrong and problematic.
Just providing the whole image name as a string is completely ok here (rhoar-nodejs/nodejs-10:latest). The image name will always have / as a separator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Nov 18, 2020
@kadel
Copy link
Member

kadel commented Nov 18, 2020

/hold
please don't merge this before this gets properly fixed. (see: #4234 (comment))

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Nov 18, 2020
Signed-off-by: anandrkskd <anandrkskd@gmail.com>
@anandrkskd
Copy link
Contributor Author

/test v4.5-integration-e2e

@@ -89,35 +89,35 @@ var _ = Describe("odo supported images e2e tests", func() {
})

It("Should be able to verify the nodejs-10 image", func() {
oc.ImportImageFromRegistry("registry.access.redhat.com", filepath.Join("rhoar-nodejs", "nodejs-10:latest"), "nodejs:latest", commonVar.Project)
verifySupportedImage(filepath.Join("rhoar-nodejs", "nodejs-10:latest"), "nodejs", "nodejs:latest", commonVar.Project, appName, commonVar.Context)
oc.ImportImageFromRegistry("registry.access.redhat.com", "rhoar-nodejs"+"/"+"nodejs-10:latest", "nodejs:latest", commonVar.Project)
Copy link
Member

Choose a reason for hiding this comment

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

Why are you using + to concatenate two strings like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I miss understood the above comment, Just providing the whole image name as a string is okay but in the helper function well will require to concatenate should I use string.join?

Copy link
Member

@kadel kadel Nov 19, 2020

Choose a reason for hiding this comment

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

just do "rhoar-nodejs/nodejs-10:latest" here, no need to complicate it

CmdShouldPass(oc.path, "--request-timeout", "5m", "import-image", cmpType, "--namespace="+project, "--from="+filepath.Join(registry, image), "--confirm")
CmdShouldPass(oc.path, "annotate", filepath.Join("istag", cmpType), "--namespace="+project, "tags=builder", "--overwrite")
CmdShouldPass(oc.path, "--request-timeout", "5m", "import-image", cmpType, "--namespace="+project, "--from="+registry+"/"+image, "--confirm")
CmdShouldPass(oc.path, "annotate", filepath.ToSlash(filepath.Join("istag", cmpType)), "--namespace="+project, "tags=builder", "--overwrite")
Copy link
Member

Choose a reason for hiding this comment

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

Don't use filepath if it is not file path.

just do
fmt.Sprintf("istag/%s", cmpType) or "istag/"+ cmpType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
@anandrkskd
Copy link
Contributor Author

/test v4.5-integration-e2e

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
@rnapoles-rh
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Dec 1, 2020
@kadel
Copy link
Member

kadel commented Dec 1, 2020

/hold cancel
/approve

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Dec 1, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Dec 1, 2020
@anandrkskd
Copy link
Contributor Author

/test v4.6-integration-e2e

@openshift-merge-robot openshift-merge-robot merged commit 5d99068 into redhat-developer:master Dec 2, 2020
@anandrkskd anandrkskd deleted the windows-path-seperator-fix branch September 28, 2021 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
6 participants