Merge pull request #60943 from jennybuckley/webhook-https-url

Automatic merge from submit-queue (batch tested with PRs 60906, 60943). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make admission webhooks honor scheme part of url

**What this PR does / why we need it**:
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
(more in issue)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60942

```release-note
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
```

/kind bug
/sig api-machinery
This commit is contained in:
Kubernetes Submit Queue 2018-03-08 15:18:46 -08:00 committed by GitHub
commit 71b40cbce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ func (cm *ClientManager) HookClient(h *v1beta1.Webhook) (*rest.RESTClient, error
}
cfg := rest.CopyConfig(restConfig)
cfg.Host = u.Host
cfg.Host = u.Scheme + "://" + u.Host
cfg.APIPath = u.Path
return complete(cfg)