Repository: kubernetes-client/javascript
Pull request #1037 (2023-04-11 13:04:39)

fix: casing of `applyToHttpsOptions`
Technically this is a breaking change but I  guess a `fix` is fine for these kind of change?

k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-client/javascript/pull/1037#" title="Author self-approved">mstruebing</a>*
**Once this PR has been reviewed and has the lgtm label**, please assign brendandburns for approval. For more information see [the Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-client%2Fjavascript).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-client/javascript/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["brendandburns"]} -->

Patch:
diff --git a/src/config.ts b/src/config.ts
index 76c40df9..d35de407 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -130,7 +130,7 @@ export class KubeConfig {
         this.makePathsAbsolute(rootDirectory);
     }
 
-    public async applytoHTTPSOptions(opts: https.RequestOptions | WebSocket.ClientOptions): Promise<void> {
+    public async applyToHTTPSOptions(opts: https.RequestOptions | WebSocket.ClientOptions): Promise<void> {
         await this.applyOptions(opts);
 
         const user = this.getCurrentUser();
diff --git a/src/proto-client.ts b/src/proto-client.ts
index 1d885ca1..e726f339 100644
--- a/src/proto-client.ts
+++ b/src/proto-client.ts
@@ -14,7 +14,7 @@ export class ProtoClient {
             hostname: u.hostname,
             protocol: u.protocol,
         };
-        await this.config.applytoHTTPSOptions(options);
+        await this.config.applyToHTTPSOptions(options);
         const req = http.request(options);
 
         const result = await new Promise<any>((resolve, reject) => {
diff --git a/src/web-socket-handler.ts b/src/web-socket-handler.ts
index 416369bb..64e9ef3e 100644
--- a/src/web-socket-handler.ts
+++ b/src/web-socket-handler.ts
@@ -166,7 +166,7 @@ export class WebSocketHandler implements WebSocketInterface {
 
         const opts: WebSocket.ClientOptions = {};
 
-        await this.config.applytoHTTPSOptions(opts);
+        await this.config.applyToHTTPSOptions(opts);
 
         return await new Promise<WebSocket>((resolve, reject) => {
             const client = this.socketFactory


Test patch:
diff --git a/src/config_test.ts b/src/config_test.ts
index 3506258a..ecd97c3a 100644
--- a/src/config_test.ts
+++ b/src/config_test.ts
@@ -246,7 +246,7 @@ describe('KubeConfig', () => {
             kc.loadFromFile(kcTlsServerNameFileName);
 
             const opts: https.RequestOptions = {};
-            await kc.applytoHTTPSOptions(opts);
+            await kc.applyToHTTPSOptions(opts);
 
             expect(opts).to.deep.equal({
                 headers: {},
@@ -285,7 +285,7 @@ describe('KubeConfig', () => {
             kc.loadFromFile(kcFileName);
 
             const opts: https.RequestOptions = {};
-            kc.applytoHTTPSOptions(opts);
+            kc.applyToHTTPSOptions(opts);
 
             expect(opts).to.deep.equal({
                 headers: {},
@@ -701,7 +701,7 @@ describe('KubeConfig', () => {
 
             config.loadFromClusterAndUser({} as Cluster, { username: user, password: passwd } as User);
             const opts = {} as https.RequestOptions;
-            await config.applytoHTTPSOptions(opts);
+            await config.applyToHTTPSOptions(opts);
 
             expect(opts.auth).to.equal(`${user}:${passwd}`);
         });