-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,21 @@ jobs: | |
go-version: "1.23" | ||
|
||
- name: Build | ||
run: go build -o kc cmd/kc.go | ||
run: go build -o kubectl-cs cmd/kubectl-cs.go | ||
|
||
- name: Release file | ||
- name: Package file | ||
run: | | ||
rm kubectl-cs.tar.gz &>/dev/null | ||
tar czf kubectl-cs.tar.gz kubectl-cs LICENSE | ||
- name: Release | ||
uses: djnicholson/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-name: ${{ github.event.release.name }} | ||
tag-name: ${{ github.event.release.tag_name }} | ||
asset-name: kc-${{ matrix.goos }}-${{ matrix.goarch }} | ||
file: kc | ||
asset-name: kubectl-cs-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz | ||
file: kubectl-cs.tar.gz | ||
|
||
- name: Update new version in krew-index | ||
uses: rajatjindal/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: krew.googlecontainertools.github.com/v1alpha2 | ||
kind: Plugin | ||
metadata: | ||
name: cs | ||
spec: | ||
version: {{ .TagName }} | ||
homepage: https://github.com/dodevops/kc | ||
platforms: | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-darwin-amd64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
- selector: | ||
matchLabels: | ||
os: darwin | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-darwin-arm64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
- selector: | ||
matchLabels: | ||
os: windows | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-windows-amd64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
- selector: | ||
matchLabels: | ||
os: windows | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-windows-arm64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: amd64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-linux-amd64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
- selector: | ||
matchLabels: | ||
os: linux | ||
arch: arm64 | ||
{{addURIAndSha "https://github.com/dodevops/kc/releases/download/{{ .TagName }}/kubectl-cs-linux-arm64.tar.gz" .TagName }} | ||
bin: kubectl-cs | ||
shortDescription: Quick Kubernetes context switcher | ||
description: | | ||
Usage: | ||
kubectl cs [--only-current-context] [target] | ||
Run `kubectl cs` to switch to a Kubernetes context and/or namespace. You can directly specify the context to switch to | ||
in the form of `context:namespace`. If you leave either of the two parts empty, it will only change the remaining part. | ||
Examples: | ||
* `kubectl cs int:` - Switch to the currently active namespace in the `int` context | ||
* `kubectl cs :kube-system` - Switch to the namespace `kube-system` in the currently active context | ||
* `kubectl cs int:kube-system` - Switch to the namespace `kube-system` in the `int` context | ||
If you don't specify anything, `kubectl cs` will present a selection list of all namespaces in all contexts, which can | ||
be filtered and selected. If that takes too long, the flag `--only-current-context` can be used, which only enumerates | ||
the namespaces of the current context. |