Skip to content

Commit 95afde0

Browse files
author
Daniel Herbolt
committed
Merge branch 'main' into release-1.1.patch-dherbolt
2 parents a14aa67 + 59df3e8 commit 95afde0

File tree

768 files changed

+102249
-86732
lines changed

Some content is hidden

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

768 files changed

+102249
-86732
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ updates:
66
interval: 'daily'
77
time: '02:00'
88
target-branch: 'main'
9-
- package-ecosystem: 'npm'
10-
directory: '/'
11-
target-branch: 'master'
12-
schedule:
13-
interval: 'daily'
14-
time: '01:00'
159
- package-ecosystem: 'github-actions'
1610
directory: '/'
1711
schedule:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v4.2.2
41+
uses: actions/checkout@v5.0.0
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL

.github/workflows/deploy-docs.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
name: Build and Deploy Docs
22
on:
3-
push:
4-
branches:
5-
- master
3+
push:
4+
branches:
5+
- main
66
jobs:
7-
build-and-deploy-docs:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v4.2.2
12-
- name: Setup Node.js
13-
uses: actions/setup-node@v4
14-
with:
15-
node-version: '20'
16-
# Pre-check to validate that versions match between package.json
17-
# and package-lock.json. Needs to run before npm install
18-
- name: Validate package.json and package-lock.json versions
19-
run: node version-check.js
20-
- name: Install dependencies
21-
run: npm ci
22-
- name: Build docs
23-
run: npm run docs
7+
build-and-deploy-docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v5.0.0
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v5
14+
with:
15+
node-version: '20'
16+
# Pre-check to validate that versions match between package.json
17+
# and package-lock.json. Needs to run before npm install
18+
- name: Validate package.json and package-lock.json versions
19+
run: node version-check.js
20+
- name: Install dependencies
21+
run: npm ci
22+
- name: Build docs
23+
run: npm run docs
2424

25-
- name: Deploy docs
26-
uses: JamesIves/github-pages-deploy-action@v4.7.3
27-
with:
28-
branch: gh-pages # The branch the action should deploy to.
29-
folder: docs # The folder the action should deploy.
25+
- name: Deploy docs
26+
uses: JamesIves/github-pages-deploy-action@v4.7.3
27+
with:
28+
branch: gh-pages # The branch the action should deploy to.
29+
folder: docs # The folder the action should deploy.
Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
name: Generate
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
kubernetesBranch:
7-
type: string
8-
required: true
9-
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
10-
genCommit:
11-
type: string
12-
required: true
13-
default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6'
14-
description: 'The commit to use for the kubernetes-client/gen repo'
15-
4+
workflow_dispatch:
5+
inputs:
6+
kubernetesBranch:
7+
type: string
8+
required: true
9+
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
10+
genCommit:
11+
type: string
12+
required: true
13+
default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6'
14+
description: 'The commit to use for the kubernetes-client/gen repo'
1615

1716
jobs:
18-
generate:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout Javascript
22-
uses: actions/checkout@v4.2.2
23-
- name: Setup Node
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: '20'
27-
- name: Generate Openapi
28-
run: |
29-
echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings"
30-
echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings"
31-
./generate-client.sh
32-
- name: Generate Branch Name
33-
run: |
34-
SUFFIX=$(openssl rand -hex 4)
35-
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
36-
- name: Commit and push
37-
run: |
38-
# Commit and push
39-
git config user.email "k8s.ci.robot@gmail.com"
40-
git config user.name "Kubernetes Prow Robot"
41-
git checkout -b "$BRANCH"
42-
git add .
43-
# we modify the settings file in "Generate Openapi" but do not want to commit this
44-
git reset settings
45-
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
46-
git push origin "$BRANCH"
47-
- name: Pull Request
48-
uses: repo-sync/pull-request@v2
49-
with:
50-
source_branch: ${{ env.BRANCH }}
51-
destination_branch: ${{ github.ref_name }}
52-
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}"
17+
generate:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Javascript
21+
uses: actions/checkout@v5.0.0
22+
- name: Setup Node
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version: '20'
26+
- name: Generate Openapi
27+
run: |
28+
echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings"
29+
echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings"
30+
./generate-client.sh
31+
- name: Generate Branch Name
32+
run: |
33+
SUFFIX=$(openssl rand -hex 4)
34+
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
35+
- name: Commit and push
36+
run: |
37+
# Commit and push
38+
git config user.email "k8s.ci.robot@gmail.com"
39+
git config user.name "Kubernetes Prow Robot"
40+
git checkout -b "$BRANCH"
41+
git add .
42+
# we modify the settings file in "Generate Openapi" but do not want to commit this
43+
git reset settings
44+
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
45+
git push origin "$BRANCH"
46+
- name: Pull Request
47+
uses: repo-sync/pull-request@v2
48+
with:
49+
source_branch: ${{ env.BRANCH }}
50+
destination_branch: ${{ github.ref_name }}
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}'

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
environment: production
3434
steps:
3535
- name: Checkout Javascript
36-
uses: actions/checkout@v4.2.2
36+
uses: actions/checkout@v5.0.0
3737
- name: Setup Node
38-
uses: actions/setup-node@v4
38+
uses: actions/setup-node@v5
3939
with:
4040
node-version: '20'
4141
registry-url: 'https://registry.npmjs.org'

.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: ['23', '22', '20', '18']
14+
node: ['24', '23', '22', '20', '18']
1515
name: Node ${{ matrix.node }} validation
1616
steps:
17-
- uses: actions/checkout@v4.2.2
18-
- uses: actions/setup-node@v4
17+
- uses: actions/checkout@v5.0.0
18+
- uses: actions/setup-node@v5
1919
with:
2020
node-version: ${{ matrix.node }}
2121
# Pre-check to validate that versions match between package.json

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ k8sApi.createNamespace({ body: namespace }).then(
6363
);
6464
```
6565

66-
## Create a cluster configuration programatically
66+
## Create a cluster configuration programmatically
6767

6868
```javascript
6969
const k8s = require('@kubernetes/client-node');
@@ -112,16 +112,17 @@ release, we will increment the minor version whenever we update the minor Kubern
112112

113113
We switched from `request` to `fetch` as the HTTP(S) backend for the `1.0.0` release.
114114

115-
Generally speaking newer clients will work with older Kubernetes, but compatability isn't 100% guaranteed.
115+
Generally speaking newer clients will work with older Kubernetes, but compatibility isn't 100% guaranteed.
116116

117-
| client version | older versions | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 |
118-
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- |
119-
| 0.19.x | - || x | x | x | x |
120-
| 0.20.x | - | + || x | x | x |
121-
| 0.21.x | - | + | + || x | x |
122-
| 0.22.x | - | + | + | + || x |
123-
| 1.0.x | - | + | + | + | + ||
124-
| 1.1.x | - | + | + | + | + ||
117+
| client version | older versions | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 | 1.33 |
118+
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- | ---- |
119+
| 0.19.x | - || x | x | x | x | x |
120+
| 0.20.x | - | + || x | x | x | x |
121+
| 0.21.x | - | + | + || x | x | x |
122+
| 0.22.x | - | + | + | + || x | x |
123+
| 1.0.x | - | + | + | + | + || x |
124+
| 1.1.x | - | + | + | + | + || x |
125+
| 1.2.x | - | + | + | + | + | + ||
125126

126127
Key:
127128

@@ -142,6 +143,8 @@ Key:
142143
Credentials are cached based on the kubeconfig username and these can collide across configs.
143144
Here is the related [issue](https://github.com/kubernetes-client/javascript/issues/592).
144145

146+
- In scenarios where multiple headers with the same key are required in a request, such as `Impersonate-Group`, avoid using `fetch`. Fetch will merge the values into a single header key, with the values as a single string vs a list of strings, `Impersonate-Group: "group1,group2"`. The workaround is to use a low-level library such as `https` to make the request. Refer to issue [#2474](https://github.com/kubernetes-client/javascript/issues/2474) for more details.
147+
145148
# Development
146149

147150
All dependencies of this project are expressed in its

examples/patch-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ try {
2020

2121
await k8sApi.patchNamespacedPod(
2222
{ name: res?.items?.[0]?.metadata?.name ?? '', namespace, body: patch },
23-
k8s.setHeaderOptions('Content-Type', k8s.JsonPatch),
23+
k8s.setHeaderOptions('Content-Type', k8s.PatchStrategy.JsonPatch),
2424
);
2525

2626
console.log('Patched.');

0 commit comments

Comments
 (0)