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

Refactor OCPControllerManager to conform to the internal service manager #260

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

husky-parul
Copy link
Contributor

Refactor OCPControllerManager to conform to the internal service manager #239

Signed-off-by: Parul [email protected]

Which issue(s) this PR addresses:

Closes#239

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 9, 2021
@openshift-ci openshift-ci bot requested review from copejon and fzdarsky September 9, 2021 16:53
@husky-parul husky-parul changed the title [WIP] Refactor OCPControllerManager to conform to the internal service manager Refactor OCPControllerManager to conform to the internal service manager Sep 9, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 9, 2021
@husky-parul husky-parul requested review from rootfs and oglok September 9, 2021 17:38
pkg/util/net.go Outdated
status := 0
err := wait.Poll(5*time.Second, 120*time.Second, func() (bool, error) {
timeout := 3 * time.Second
_, err := tcpnet.DialTimeout("tcp", tcpnet.JoinHostPort("127.0.0.1", "8445"), timeout)
Copy link
Member

Choose a reason for hiding this comment

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

host and port

pkg/util/net.go Outdated
_, err := tcpnet.DialTimeout("tcp", tcpnet.JoinHostPort("127.0.0.1", "8445"), timeout)

if err == nil {
status = 200
Copy link
Member

Choose a reason for hiding this comment

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

200 is HTTP status. If this is for TCP port probe, returning true/false is good to go

pkg/util/net.go Outdated
func RetryTCPConnection(host string, port string) int {
status := 0
err := wait.Poll(5*time.Second, 120*time.Second, func() (bool, error) {
timeout := 3 * time.Second
Copy link
Member

Choose a reason for hiding this comment

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

can you check what's the default timeout in net/http? 3 seconds could be too short

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default timeout is no timeout so it will keep trying infinitely.
golang/go#24138

Increasing it to 30 * time.Second, I see it is the recommended timeout -> https://pkg.go.dev/net/http

@rootfs
Copy link
Member

rootfs commented Sep 15, 2021

/approve
/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 15, 2021
@rootfs
Copy link
Member

rootfs commented Sep 22, 2021

/retest

@@ -68,17 +68,17 @@ kubectl get pods -A
### Access the cluster on the host
#### Linux
```bash
export KUBECONFIG=$(podman volume inspect ushift-vol --format "{{.Mountpoint}}")/microshift/resources/kubeadmin/kubeconfig
export KUBECONFIG=$(podman volume inspect microshift-data --format "{{.Mountpoint}}")/microshift/resources/kubeadmin/kubeconfig
Copy link
Member

Choose a reason for hiding this comment

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

can you revert these changes?

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 will. Can't get the tests to pass though. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you revert these changes?

Will the changes to volume name will go in a different PR or we don't need this change at all? All other places use microshift-data as the volume name instead of ushift-vol

pkg/util/net.go Outdated
_, err := tcpnet.DialTimeout("tcp", tcpnet.JoinHostPort(host, port), timeout)

if err == nil {
status = false
Copy link
Member

Choose a reason for hiding this comment

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

why set it false?

return false, nil
})
if err != nil && err == wait.ErrWaitTimeout {
logrus.Warningf("Endpoint is not returning any status code")
Copy link
Member

Choose a reason for hiding this comment

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

if timeout, this should return false to tell the caller the connection is not ready

@husky-parul husky-parul force-pushed the ocp-cm branch 2 times, most recently from 78207fd to d66ecb7 Compare September 22, 2021 20:44
@husky-parul
Copy link
Contributor Author

/retest

@husky-parul
Copy link
Contributor Author

/test e2e-openshift-conformance-sig-instrumentation

@rootfs
Copy link
Member

rootfs commented Sep 22, 2021

/lgtm
/assign @oglok

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rootfs

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

@rootfs
Copy link
Member

rootfs commented Sep 22, 2021

@oglok @mangelajo please take a final review

@rootfs rootfs merged commit 5e4f53b into openshift:main Sep 27, 2021
@husky-parul husky-parul deleted the ocp-cm branch September 29, 2021 19:34
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants