Skip to content

Commit 2b0ef2a

Browse files
Merge branch 'kubernetes-client:master' into examples
2 parents e04c27b + 14b6d48 commit 2b0ef2a

File tree

658 files changed

+15773
-43635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

658 files changed

+15773
-43635
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "02:00"
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
time: "03:00"

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v2
39+
uses: actions/checkout@v3
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v1
43+
uses: github/codeql-action/init@v2
4444
with:
4545
languages: ${{ matrix.language }}
4646
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +51,7 @@ jobs:
5151
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5252
# If this step fails, then you should remove it and run the build manually (see below)
5353
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v1
54+
uses: github/codeql-action/autobuild@v2
5555

5656
# ℹ️ Command-line programs to run using the OS shell.
5757
# 📚 https://git.io/JvXDl
@@ -65,4 +65,4 @@ jobs:
6565
# make release
6666

6767
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v1
68+
uses: github/codeql-action/analyze@v2

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2.3.1
11+
uses: actions/checkout@v3
1212
- name: Setup Node.js
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v3
1414
with:
1515
node-version: '14.x'
1616
# Pre-check to validate that versions match between package.json
@@ -23,7 +23,7 @@ jobs:
2323
run: npm run docs
2424

2525
- name: Deploy docs
26-
uses: JamesIves/[email protected].4
26+
uses: JamesIves/github-pages-deploy-action@v4.4.1
2727
with:
2828
branch: gh-pages # The branch the action should deploy to.
2929
folder: docs # The folder the action should deploy.

.github/workflows/generate-javascript.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Checkout Javascript
2222
uses: actions/checkout@v3
2323
- name: Setup Node
24-
uses: actions/setup-node@v2
24+
uses: actions/setup-node@v3
2525
with:
2626
node-version: '16'
2727
- name: Checkout Gen
@@ -30,6 +30,7 @@ jobs:
3030
pushd gen
3131
git checkout "${{ github.event.inputs.genCommit }}"
3232
# apply https://github.com/kubernetes-client/gen/pull/224
33+
git config --global user.name "Github Actions"
3334
git cherry-pick --strategy=recursive -X theirs c557f7f
3435
- name: Generate Branch Name
3536
run: |

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node: [ '16', '14', '12' ]
14+
node: [ '18', '16', '14' ]
1515
name: Node ${{ matrix.node }} validation
1616
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
1919
with:
2020
node-version: ${{ matrix.node }}
2121
# Pre-check to validate that versions match between package.json

.mocharc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// Specify "require" for CommonJS
3+
"require": "ts-node/register",
4+
"extensions": ["ts"],
5+
"spec": [
6+
"src/**/*_test.ts"
7+
],
8+
"watch-files": [
9+
"src"
10+
]
11+
}

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ We'd love to accept your patches! Before we can accept them you need to sign Clo
1212
## Reporting an issue
1313
If you have any problem with the package or any suggestions, please file an [issue](https://github.com/kubernetes-client/javascript/issues).
1414

15+
Note: Before raising a new issue, please do check the existing issues and make sure it is not a duplicate one.
16+
1517
## Contributing a Patch
1618
1. Submit an issue describing your proposed change to the repo.
1719
2. Fork this repo, develop and test your code changes.

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Javascript Kubernetes Client information
22

33
[![Build Status](https://github.com/kubernetes-client/javascript/workflows/Kubernetes%20Javascript%20Client%20-%20Validation/badge.svg)](https://github.com/kubernetes-client/javascript/actions)
4-
[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Gold-blue.svg?style=flat&colorB=FFD700&colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge)
5-
[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat&colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge)
4+
[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Gold-blue.svg?style=flat&colorB=FFD700&colorA=306CE8)](https://bit.ly/kubernetes-client-capabilities-badge)
5+
[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat&colorA=306CE8)](https://bit.ly/kubernetes-client-support-badge)
66
[![Build and Deploy Docs](https://github.com/kubernetes-client/javascript/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/kubernetes-client/javascript/actions/workflows/deploy-docs.yml)
77

88
The Javascript clients for Kubernetes is implemented in
@@ -113,13 +113,14 @@ release, we will increment the minor version whenever we update the minor Kubern
113113

114114
Generally speaking newer clients will work with older Kubernetes, but compatability isn't 100% guaranteed.
115115

116-
| client version | older versions | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 |
117-
|----------------|----------------|------|------|------|------|-------|------|
118-
| 0.13.x | - || x | x | x | x | x |
119-
| 0.14.x | - | + || x | x | x | x |
120-
| 0.15.x | - | + | + || x | x | x |
121-
| 0.16.x | - | + | + | + || x | x |
122-
| 0.17.x | - | - | - | + | + | + ||
116+
| client version | older versions | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 | 1.25 |
117+
|----------------|----------------|------|------|------|------|-------|------|-----|
118+
| 0.13.x | - || x | x | x | x | x | x |
119+
| 0.14.x | - | + || x | x | x | x | x |
120+
| 0.15.x | - | + | + || x | x | x | x |
121+
| 0.16.x | - | + | + | + || x | x | x |
122+
| 0.17.x | - | - | - | + | + | + || x |
123+
| 0.18.x | - | - | - | - | + | + | + ||
123124

124125
Key:
125126

@@ -176,7 +177,7 @@ Run `npm run lint` or install an editor plugin like https://github.com/Microsoft
176177

177178
# Testing
178179

179-
Tests are written using the [Chai](http://chaijs.com/) library. See
180+
Tests are written using the [Chai](https://chaijs.com/) library. See
180181
[`config_test.ts`](./src/config_test.ts) for an example.
181182

182183
To run tests, execute the following:

examples/ingress.js

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
1-
const k8s = require('@kubernetes/client-node')
2-
const kc = new k8s.KubeConfig()
3-
kc.loadFromDefault()
1+
const k8s = require('@kubernetes/client-node');
2+
const kc = new k8s.KubeConfig();
3+
kc.loadFromDefault();
44

5-
const k8sApi = kc.makeApiClient(k8s.NetworkingV1beta1Api) // before 1.14 use extensions/v1beta1
6-
const clientIdentifier = 'my-subdomain'
5+
const k8sApi = kc.makeApiClient(k8s.NetworkingV1Api); // before 1.14 use extensions/v1beta1
6+
const clientIdentifier = 'my-subdomain';
77

88
k8sApi.createNamespacedIngress('default', {
9-
apiVersions: 'networking.k8s.io/v1beta1',
9+
apiVersions: 'networking.k8s.io/v1',
1010
kind: 'Ingress',
11-
metadata: { name: `production-custom-${clientIdentifier}` },
11+
metadata: {
12+
name: `production-custom-${clientIdentifier}`,
13+
labels: {
14+
createdBy: 'node-client',
15+
},
16+
annotations: {
17+
'meta.helm.sh/release-namespace': 'production-auto-deploy',
18+
},
19+
},
1220
spec: {
21+
ingressClassName: 'nginx',
1322
rules: [{
14-
host: `${clientIdentifier}.example.com`,
23+
host: `${clientIdentifier}`,
1524
http: {
1625
paths: [{
1726
backend: {
18-
serviceName: 'production-auto-deploy',
19-
servicePort: 5000
27+
service: {
28+
name: 'production-auto-deploy',
29+
port: {
30+
number: 5000,
31+
},
32+
},
2033
},
21-
path: '/'
22-
}]
23-
}
34+
path: '/default-kuberiq(/|$)(.*)',
35+
pathType: 'ImplementationSpecific',
36+
}],
37+
},
2438
}],
25-
tls: [{ hosts: [`${clientIdentifier}.example.com`] }]
26-
}
27-
}).catch(e => console.log(e))
39+
tls: [{
40+
hosts: [`${clientIdentifier}.example.com`],
41+
}],
42+
},
43+
}).catch(e => console.log(e));

0 commit comments

Comments
 (0)