-
Notifications
You must be signed in to change notification settings - Fork 243
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
Use custom address for port forwarding #6766
Use custom address for port forwarding #6766
Conversation
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
f67d319
to
b92e852
Compare
[FAILED] Timed out after 240.001s.
Expected
<string>: Updating Component...
Error occurred on Push - watch command was unable to push component: unable to delete remote resources: unable to delete resource: ServiceBinding/my-nodejs-app-cluster-sample-k8s: timeout while waiting for "my-nodejs-app-cluster-sample-k8s" resource to be deleted
Pushing files...
File /tmp/416227824/devfile.yaml changed
• Waiting for Kubernetes resources ...
Error occurred on Push - watch command was unable to push component: unable to delete remote resources: unable to delete resource: ServiceBinding/my-nodejs-app-cluster-sample-k8s: timeout while waiting for "my-nodejs-app-cluster-sample-k8s" resource to be deleted
• Waiting for Kubernetes resources ...
Error occurred on Push - watch command was unable to push component: unable to delete remote resources: unable to delete resource: ServiceBinding/my-nodejs-app-cluster-sample-k8s: timeout while waiting for "my-nodejs-app-cluster-sample-k8s" resource to be deleted
• Waiting for Kubernetes resources ...
to contain substring
<string>: Dev mode
In [BeforeEach] at: /go/odo_1/tests/helper/helper_run.go:54 @ 04/24/23 13:27:05.8
[FAIL] odo remove binding command tests when the component with binding is bootstrapped (bindingName=my-nodejs-app-cluster-sample-k8s) when odo dev is running when binding is removed [BeforeEach] should have led odo dev to delete ServiceBinding from the cluster [odo] I0424 12:59:49.276697 20825 exec.go:49] ExecuteCommand returned an an err: error while streaming command: error sending request: Post "https://c100-e.eu-de.containers.cloud.ibm.com:31988/api/v1/namespaces/cmd-dev-test1984unx/pods/wevhqk-app-5467ccf857-2hwvc/exec?command=%2Fbin%2Fsh&command=-c&command=cat+%2Fopt%2Fodo%2F.odo_cmd_start.pid+%7C%7C+true&container=runtime&stderr=true&stdout=true": dial tcp: lookup c100-e.eu-de.containers.cloud.ibm.com: operation was canceled. for command '[/bin/sh -c cat /opt/odo/.odo_cmd_start.pid || true]'
[odo] stdout: []
[odo] stderr: []
[odo] I0424 12:59:49.276755 20825 execute_run.go:36] error while running background command: unable to exec command [/bin/sh -c echo $$ > /opt/odo/.odo_cmd_start.pid && cd /projects && (npm start) 1>>/proc/1/fd/1 2>>/proc/1/fd/2; echo $? >> /opt/odo/.odo_cmd_start.pid]: error while streaming command: context canceled
[odo] I0424 12:59:49.279169 20825 service.go:124] Getting instances of: servicebindings.servicebinding.io
[odo] I0424 12:59:49.293852 20825 service.go:124] Getting instances of: servicebindings.servicebinding.io
[odo] Cleaning resources, please wait
[odo] I0424 12:59:49.467107 20825 all.go:46] starting to concurrently query 195 APIs
[odo] I0424 12:59:49.475709 20825 all.go:62] fired up all goroutines to query APIs
[odo] I0424 12:59:51.603322 20825 all.go:67] all goroutines have returned in 2.136211926s
[odo] I0424 12:59:51.603410 20825 all.go:76] query result: objects=589
[odo] I0424 13:00:24.308542 20825 all.go:46] starting to concurrently query 195 APIs
[odo] I0424 13:00:24.308842 20825 all.go:62] fired up all goroutines to query APIs
[odo] I0424 13:00:26.718846 20825 all.go:67] all goroutines have returned in 2.410359999s
[odo] I0424 13:00:26.718914 20825 all.go:76] query result: objects=584
[odo] I0424 13:00:29.037872 20825 all.go:46] starting to concurrently query 195 APIs
[odo] I0424 13:00:29.041418 20825 all.go:62] fired up all goroutines to query APIs
[odo] I0424 13:00:29.910789 20825 all.go:67] all goroutines have returned in 872.917324ms
[odo] I0424 13:00:29.910856 20825 all.go:76] query result: objects=581
[odo] Failed to delete the "Deployment" resource: my-k8s-component
[odo] I0424 13:01:30.171792 20825 delete.go:94] failed to delete resource "my-k8s-component" (apps.v1.deployments): timeout while waiting for "my-k8s-component" resource to be deleted
[odo] ✗ Dev mode interrupted by user
Running oc with args [oc get deployments] and odo env: []
[oc] NAME READY UP-TO-DATE AVAILABLE AGE
[oc] my-k8s-component 0/1 0 0 4m28s
[FAILED] in [It] - /go/odo_1/tests/integration/cmd_dev_test.go:2032 @ 04/24/23 13:01:30.827
Deleting project: cmd-dev-test1984unx
Running oc with args [oc delete project cmd-dev-test1984unx --wait=false] and odo env: []
[oc] project.project.openshift.io "cmd-dev-test1984unx" deleted
Setting current dir to: /go/odo_1/tests/integration
Deleting dir: /tmp/556083651
Deleting dir: /tmp/1211826814
<< Timeline
[FAILED] Expected
<string>: NAME READY UP-TO-DATE AVAILABLE AGE
my-k8s-component 0/1 0 0 4m28s
not to contain substring
<string>: my-k8s-component
In [It] at: /go/odo_1/tests/integrat
[FAIL] odo dev command tests 1. devfile contains composite apply command when odo dev is running [It] should execute the composite apply commands successfully |
5fa1b15
to
66c2455
Compare
66c2455
to
9a6ce8a
Compare
9a6ce8a
to
bc587b8
Compare
Summarizing 2 Failures:
[FAIL] odo delete command tests when a component is bootstrapped using a devfile.yaml with URI-referenced Kubernetes components when the component is running in both DEV and DEPLOY mode and dev mode is killed when the component is deleted using its name and namespace from another directory [It] should delete the appropriate resources
C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_oc.go:34
Running oc.exe with args [oc get deployment -n cmd-delete-test670wxb] and odo env: []
[oc] NAME READY UP-TO-DATE AVAILABLE AGE
[oc] my-component 0/1 1 0 21s
STEP: not deleting Deploy resources @ 04/26/23 10:08:53.757
Running oc.exe with args [oc get deployment -n cmd-delete-test670wxb] and odo env: []
[oc] Unable to connect to the server: dial tcp 161.156.12.82:31700: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[FAILED] in [It] - C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_oc.go:34 @ 04/26/23 10:09:14.936
Deleting project: cmd-delete-test670wxb
Running oc.exe with args [oc delete project cmd-delete-test670wxb --wait=false] and odo env: []
[oc] project.project.openshift.io "cmd-delete-test670wxb" deleted
Setting current dir to: C:\Users\Administrator.ANSIBLE-TEST-VS\3817\tests\integration
Deleting dir: C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\4181276825
Deleting dir: C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\3889731846
<< Timeline
[FAILED] No future change is possible. Bailing out early after 21.172s.
Expected
<int>: 1
to match exit code:
<int>: 0
[FAIL] odo describe/list binding command tests [BeforeEach] when creating a component with a binding as files (service in namespace "binding-elm") when Starting a Pg service when running dev session when changing the current namespace should list the binding with --namespace flag
C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_cmd_wrapper.go:101
Running oc.exe with args [oc create configmap config-map-for-cleanup --from-literal type=testing --from-literal team=odo -n cmd-describe-list-binding-test787rhg] and odo env: []
[oc] error: failed to create configmap: Post "https://c115-e.eu-de.containers.cloud.ibm.com:31700/api/v1/namespaces/cmd-describe-list-binding-test787rhg/configmaps?fieldManager=kubectl-create": dial tcp 161.156.12.82:31700: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
[FAILED] in [BeforeEach] - C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_cmd_wrapper.go:101 @ 04/26/23 10:32:00.503
Deleting project: cmd-describe-list-binding-test787ail
Running oc.exe with args [oc delete project cmd-describe-list-binding-test787ail --wait=false] and odo env: []
[oc] Error from server (NotFound): namespaces "cmd-describe-list-binding-test787ail" not found
[FAILED] in [AfterEach] - C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_cmd_wrapper.go:101 @ 04/26/23 10:32:00.756
<< Timeline
[FAILED] No future change is possible. Bailing out early after 21.159s.
Running oc.exe with args [oc create configmap config-map-for-cleanup --from-literal type=testing --from-literal team=odo -n cmd-describe-list-binding-test787rhg] and odo env: []
Expected
<int>: 1
to match exit code:
<int>: 0
In [BeforeEach] at: C:/Users/Administrator.ANSIBLE-TEST-VS/3817/tests/helper/helper_cmd_wrapper.go:101 @ 04/26/23 10:32:00.503
/override windows-integration-test/Windows-test |
@valaparthvi: Overrode contexts on behalf of valaparthvi: windows-integration-test/Windows-test 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. |
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.
Works great for me
Just a little typo
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.
One more thing I just noticed: I think the HostIp
field for the Pod Spec on Podman should also be set to the custom address. Otherwise, Podman will try to listen on all interfaces by default:
$ nc -v -l 127.0.0.1 20001
# This should work, but fails with:
# listen tcp 0.0.0.0:20001: bind: address already in use
$ odo dev --address=127.0.0.2 --port-forward 20001:8080 --platform podman
|
||
:::note | ||
If you are on macOS, you may not be able to run 2 podman sessions in parallel without defining a custom port mapping or custom address. | ||
By default, we use 127.0.0.1 address, so if 1 session is already using port 20001, the second session might also end up with port 20001 because macOS seems to think of it as a free port. |
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.
As discussed the other day, I think now that we are using 127.0.0.1
as the default address (even on Podman), and checking if the port is free using the same address we listen on, maybe this should work on MacOS now..
At least, that was the regression observed on the Linux kernel, but not sure on MacOS: the Linux kernel thought that 0.0.0.0:$port
was free even if 127.0.0.1:$port
was not, but it worked correctly if we were using the exact same address and port combination.
Can you confirm this on MacOS?
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.
Oh you're right. It's works well in parallel for both podman and cluster on 127.0.0.1(default), but fails for cluster on 0.0.0.0.
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
…alidate() method, add integration test for running parallel dev sessions on same platform, same port and different addresses Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
0353bb6
to
cac1785
Compare
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.
Thanks, Parthvi for your work on this!
tests/integration/cmd_dev_test.go
Outdated
podman := podman | ||
Context(fmt.Sprintf("multiple dev sessions with different project are running on same platform (podman=%v), same port", podman), helper.LabelPodmanIf(podman, func() { | ||
if runtime.GOOS == "darwin" { | ||
Skip("cannot run this test out of the box on macOS because the test uses a custom address in the range 127.0.0/8 and for macOS we need to ensure the addresses are open for request before using them; Ref: https://superuser.com/questions/458875/how-do-you-get-loopback-addresses-other-than-127-0-0-1-to-work-on-os-x#458877") |
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 think Skip
needs to be used on Ginkgo subject/setup nodes (BeforeEach
for example). I guess it cannot be used on Context
: https://onsi.github.io/ginkgo/#skipping-specs
Co-authored-by: Armel Soro <asoro@redhat.com> Signed-off-by: Parthvi Vala <pvala@redhat.com>
cac1785
to
8c510d9
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Windows failure: [FAILED] in [It] - C:/Users/Administrator.ANSIBLE-TEST-VS/3862/tests/e2escenarios/e2e_test.go:431 @ 05/02/23 04:56:24.933
Deleting project: e2e-test462ijb
Running oc.exe with args [oc delete project e2e-test462ijb --wait=false] and odo env: []
[oc] project.project.openshift.io "e2e-test462ijb" deleted
Setting current dir to: C:\Users\Administrator.ANSIBLE-TEST-VS\3862\tests\e2escenarios
Deleting dir: C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\738157006
Unable to delete C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\738157006 on attempt #1, trying again...
[odo] I0502 04:56:25.323474 10608 watch.go:339] filesystem watch event: REMOVE "C:\\Users\\Administrator.ANSIBLE-TEST-VS\\AppData\\Local\\Temp\\738157006\\.gitignore"
[odo] I0502 04:56:25.323774 10608 watch.go:374] error removing watch for C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\738157006\.gitignore: GetFileAttributes: The system cannot find the file specified.
[odo] I0502 04:56:25.324182 10608 watch.go:339] filesystem watch event: REMOVE "C:\\Users\\Administrator.ANSIBLE-TEST-VS\\AppData\\Local\\Temp\\738157006\\.odo\\devstate.10608.json"
[odo] I0502 04:56:25.324326 10608 watch.go:374] error removing watch for C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\738157006\.odo\devstate.10608.json: GetFileAttributes: The system cannot find the path specified.
Unable to delete C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\738157006 on attempt #11, trying again...
[FAILED] in [AfterEach] - C:/Users/Administrator.ANSIBLE-TEST-VS/3862/tests/helper/helper_filesystem.go:45 @ 05/02/23 04:58:31.285
<< Timeline
[FAILED] Expected
<*url.Error | 0xc000790e40>: {
Op: "Post",
URL: "http://127.0.0.1:60860/api/newuser",
Err: <*errors.errorString | 0xc000184100>{s: "EOF"},
}
to be nil
In [It] at: C:/Users/Administrator.ANSIBLE-TEST-VS/3862/tests/e2escenarios/e2e_test.go:431 @ 05/02/23 04:56:24.933
There were additional failures detected. To view them in detail run ginkgo -vv
------------------------------
+ [258.337 seconds]
E2E Test starting with non-empty Directory should verify developer workflow from non-empty Directory
C:/Users/Administrator.ANSIBLE-TEST-VS/3862/tests/e2escenarios/e2e_test.go:197
Captured StdOut/StdErr Output >>
Spawning 'C:\Users\Administrator.ANSIBLE-TEST-VS\3862\bin\odo.exe init' from C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\3054344395
Spawning 'C:\Users\Administrator.ANSIBLE-TEST-VS\3862\bin\odo.exe delete component' from C:\Users\Administrator.ANSIBLE-TEST-VS\AppData\Local\Temp\3054344395
<< Captured StdOut/StdErr Output
------------------------------
Summarizing 1 Failure:
[FAIL] E2E Test starting with non-empty Directory add Binding [It] should verify developer workflow of using binding as env in innerloop
C:/Users/Administrator.ANSIBLE-TEST-VS/3862/tests/e2escenarios/e2e_test.go:431 |
Flaky E2E test (#6582) /override OpenShift-Integration-tests/OpenShift-Integration-tests |
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests 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. |
Previous run of this test passed. /override Kubernetes-Integration-Tests/Kubernetes-Integration-Tests |
@rm3l: Overrode contexts on behalf of rm3l: Kubernetes-Integration-Tests/Kubernetes-Integration-Tests 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. |
What type of PR is this:
/kind feature
What does this PR do / why we need it:
With this PR, users can now provide custom address for port forwarding.
Which issue(s) this PR fixes:
Fixes #6479
Fixes part of #6744 (works as a workaround, need to document this behavior)
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
0.
odo init --devfile go --starter go-starter --name custom-address-go-app
odo dev --address 192.168.0.2