Skip to content

Change the method to get the ApiServer hostname #855

Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
a7vicky:master
Jul 28, 2020
Merged

Change the method to get the ApiServer hostname #855
openshift-merge-robot merged 2 commits intoopenshift:masterfrom
a7vicky:master

Conversation

@a7vicky
Copy link
Member

@a7vicky a7vicky commented May 12, 2020

The kube-apiserver operator is going to degraded state while changing ApiServer URL in Infrastructure config.

Note: If there is no port specified

Ref:
https://github.com/openshift/cluster-kube-apiserver-operator/blob/master/pkg/operator/certrotationcontroller/externalloadbalancer.go#L24

I0511 16:20:50.553418 1 servicehostname.go:40] syncing servicenetwork hostnames: [172.30.0.1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local openshift openshift.default openshift.default.svc openshift.default.svc.cluster.local]
I0511 16:20:50.553446 1 panic.go:679] Finished waiting for CertRotation
I0511 16:20:50.553456 1 panic.go:679] Shutting down CertRotation
panic: runtime error: slice bounds out of range [:-1]

goroutine 271 [running]:
github.com/openshift/cluster-kube-apiserver-operator/pkg/operator/certrotationcontroller.(*CertRotationController).syncExternalLoadBalancerHostnames(0xc000a980a0, 0x0, 0x0)
github.com/openshift/cluster-kube-apiserver-operator@/pkg/operator/certrotationcontroller/externalloadbalancer.go:24 +0x295

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 12, 2020
@openshift-ci-robot
Copy link

Hi @garbagego. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

hostname = strings.Replace(hostname, "https://", "", 1)
hostname = hostname[0:strings.LastIndex(hostname, ":")]
hostname_arr := strings.Split(hostname, ":")
hostname = hostname_arr[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

docs say:

        // apiServerURL is a valid URI with scheme(http/https), address and
	// port.  apiServerURL can be used by components like the web console
	// to tell users where to find the Kubernetes API.
	APIServerURL string `json:"apiServerURL"`

I.e. we are supposed to always have a port. This merely looks like missing validation.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttts yes based on Doc it seems missing validation. But why we need to provide port if we are using https scheme with default port 443 ? Is there any dependency or constraints which is forcing to provide ports ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Am fine with this fix here. But I would like to see a counterpart PR fixing the API doc before merging this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttts Thanks
Is this the right doc line which needs to modify?
openshift/api#646

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, file is right. Left a comment.

@sttts
Copy link
Contributor

sttts commented Jul 14, 2020

Tagged openshift/api#646. Please bump the dependencies when it has merged.

@a7vicky
Copy link
Member Author

a7vicky commented Jul 24, 2020

/test

@openshift-ci-robot
Copy link

@garbagego: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/test

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.

@sttts
Copy link
Contributor

sttts commented Jul 28, 2020

/lgtm
/approve

@sttts
Copy link
Contributor

sttts commented Jul 28, 2020

/ok-to-test

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: garbagego, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 28, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit c3a33ee into openshift:master Jul 28, 2020
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.

5 participants