Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
95 changes: 47 additions & 48 deletions .github/workflows/generate-javascript.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
name: Generate

on:
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I have no idea why there are changes in whitespaces after rebase... sorry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you back out the unrelated changes in this file and README.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I have no idea why there are changes in whitespaces after rebase... sorry.

For some unknown reason pre-commit hook reformated those files.

inputs:
kubernetesBranch:
type: string
required: true
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
genCommit:
type: string
required: true
default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6'
description: 'The commit to use for the kubernetes-client/gen repo'

workflow_dispatch:
inputs:
kubernetesBranch:
type: string
required: true
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
genCommit:
type: string
required: true
default: 'b461333bb57fa2dc2152f939ed70bac3cef2c1f6'
description: 'The commit to use for the kubernetes-client/gen repo'

jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout Javascript
uses: actions/[email protected]
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Generate Openapi
run: |
echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings"
echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings"
./generate-client.sh
- name: Generate Branch Name
run: |
SUFFIX=$(openssl rand -hex 4)
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
- name: Commit and push
run: |
# Commit and push
git config user.email "[email protected]"
git config user.name "Kubernetes Prow Robot"
git checkout -b "$BRANCH"
git add .
# we modify the settings file in "Generate Openapi" but do not want to commit this
git reset settings
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
git push origin "$BRANCH"
- name: Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ env.BRANCH }}
destination_branch: ${{ github.ref_name }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}"
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout Javascript
uses: actions/[email protected]
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Generate Openapi
run: |
echo "export KUBERNETES_BRANCH=${{ github.event.inputs.kubernetesBranch }} >> ./settings"
echo "export GEN_COMMIT="${{ github.event.inputs.genCommit }}" >> ./settings"
./generate-client.sh
- name: Generate Branch Name
run: |
SUFFIX=$(openssl rand -hex 4)
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
- name: Commit and push
run: |
# Commit and push
git config user.email "[email protected]"
git config user.name "Kubernetes Prow Robot"
git checkout -b "$BRANCH"
git add .
# we modify the settings file in "Generate Openapi" but do not want to commit this
git reset settings
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
git push origin "$BRANCH"
- name: Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ env.BRANCH }}
destination_branch: ${{ github.ref_name }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: 'Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}'
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ We switched from `request` to `fetch` as the HTTP(S) backend for the `1.0.0` rel

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

| client version | older versions | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 | 1.33|
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- |----|
| 0.19.x | - | ✓ | x | x | x | x | x |
| 0.20.x | - | + | ✓ | x | x | x | x |
| 0.21.x | - | + | + | ✓ | x | x | x |
| 0.22.x | - | + | + | + | ✓ | x | x |
| 1.0.x | - | + | + | + | + | ✓ | x |
| 1.1.x | - | + | + | + | + | ✓ | x |
| 1.2.x | - | + | + | + | + | + | ✓ |
| client version | older versions | 1.28 | 1.29 | 1.30 | 1.31 | 1.32 | 1.33 |
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- | ---- |
| 0.19.x | - | ✓ | x | x | x | x | x |
| 0.20.x | - | + | ✓ | x | x | x | x |
| 0.21.x | - | + | + | ✓ | x | x | x |
| 0.22.x | - | + | + | + | ✓ | x | x |
| 1.0.x | - | + | + | + | + | ✓ | x |
| 1.1.x | - | + | + | + | + | ✓ | x |
| 1.2.x | - | + | + | + | + | + | ✓ |

Key:

Expand Down
8 changes: 7 additions & 1 deletion src/cp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ export class Cp {
* @param {string} containerName - The name of the container in the pod to exec the command inside.
* @param {string} srcPath - The source path in the pod
* @param {string} tgtPath - The target path in local
* @param {string} cwd - The directory that is used as the parent in the pod when downloading
*/
public async cpFromPod(
namespace: string,
podName: string,
containerName: string,
srcPath: string,
tgtPath: string,
cwd?: string,
): Promise<void> {
const command = ['tar', 'zcf', '-', srcPath];
const command = ['tar', 'zcf', '-'];
if (cwd) {
command.push('-C', cwd);
}
command.push(srcPath);
const writerStream = tar.extract(tgtPath);
const errStream = new WritableStreamBuffer();
this.execInstance.exec(
Expand Down