Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/operator/certrotationcontroller/externalloadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func (c *CertRotationController) syncExternalLoadBalancerHostnames() error {
return nil
}
hostname = strings.Replace(hostname, "https://", "", 1)
hostname = hostname[0:strings.LastIndex(hostname, ":")]
hostname_arr := strings.Split(hostname, ":")
hostname = hostname_arr[0]
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.


klog.V(2).Infof("syncing external loadbalancer hostnames: %v", hostname)
c.externalLoadBalancer.setHostnames([]string{hostname})
Expand Down