-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Kubernetes package with wait logic (#98)
## Description This change adds a new Kubernetes package meant for related logic. It also adds functions which allows users to easily wait for resources to be properly reconciled. ## Related Issue Relates to #zarf-dev/zarf#2580 Relates to #defenseunicorns/lula#229
- Loading branch information
1 parent
325e69d
commit 4803ac2
Showing
7 changed files
with
604 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check Kubernetes | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, edited, synchronize] | ||
paths: | ||
- "kubernetes/**" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
bump-version-and-release-notes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new-version: ${{ steps.bump-version.outputs.new-version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump Version and Generate Release Notes | ||
uses: ./.github/actions/bump-and-notes | ||
id: bump-version | ||
with: | ||
module: "kubernetes" | ||
pr-title: ${{ github.event.pull_request.title }} |
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 @@ | ||
name: Release Kubernetes | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "kubernetes/**" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
bump-version-and-release-notes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new-version: ${{ steps.bump-version.outputs.new-version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump Version and Generate Release Notes | ||
uses: ./.github/actions/bump-and-notes | ||
id: bump-version | ||
with: | ||
module: "kubernetes" | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: bump-version-and-release-notes | ||
# contents: write via the GH app | ||
environment: release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Release Notes | ||
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | ||
with: | ||
name: release-notes | ||
|
||
- name: Get pkg app token | ||
id: pkg-app-token | ||
uses: actions/create-github-app-token@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1.10.0 | ||
with: | ||
app-id: ${{ vars.PKG_WORKFLOW_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.PKG_WORKFLOW_GITHUB_APP_SECRET }} | ||
owner: defenseunicorns | ||
repositories: pkg | ||
|
||
- name: Release | ||
env: | ||
GH_TOKEN: ${{ steps.pkg-app-token.outputs.token }} | ||
NEW_VERSION: ${{ needs.bump-version-and-release-notes.outputs.new-version }} | ||
run: | | ||
gh release create "$NEW_VERSION" --title "$NEW_VERSION" --notes-file notes.md |
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,65 @@ | ||
module github.com/defenseunicorns/pkg/kubernetes | ||
|
||
go 1.21.8 | ||
|
||
require ( | ||
github.com/stretchr/testify v1.8.4 | ||
k8s.io/apimachinery v0.29.1 | ||
k8s.io/client-go v0.29.1 | ||
sigs.k8s.io/cli-utils v0.36.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect | ||
github.com/evanphx/json-patch/v5 v5.6.0 // indirect | ||
github.com/go-errors/errors v1.4.2 // indirect | ||
github.com/go-logr/logr v1.3.0 // indirect | ||
github.com/go-openapi/jsonpointer v0.19.6 // indirect | ||
github.com/go-openapi/jsonreference v0.20.2 // indirect | ||
github.com/go-openapi/swag v0.22.3 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/google/gnostic-models v0.6.8 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/gofuzz v1.2.0 // indirect | ||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect | ||
github.com/google/uuid v1.3.0 // indirect | ||
github.com/imdario/mergo v0.3.13 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.12 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect | ||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/xlab/treeprint v1.2.0 // indirect | ||
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect | ||
golang.org/x/net v0.26.0 // indirect | ||
golang.org/x/oauth2 v0.10.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/sys v0.21.0 // indirect | ||
golang.org/x/term v0.21.0 // indirect | ||
golang.org/x/text v0.16.0 // indirect | ||
golang.org/x/time v0.3.0 // indirect | ||
google.golang.org/appengine v1.6.7 // indirect | ||
google.golang.org/protobuf v1.34.1 // indirect | ||
gopkg.in/evanphx/json-patch.v5 v5.6.0 // indirect | ||
gopkg.in/inf.v0 v0.9.1 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
k8s.io/api v0.29.1 // indirect | ||
k8s.io/cli-runtime v0.28.4 // indirect | ||
k8s.io/klog/v2 v2.110.1 // indirect | ||
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect | ||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect | ||
sigs.k8s.io/controller-runtime v0.16.3 // indirect | ||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect | ||
sigs.k8s.io/kustomize/api v0.15.0 // indirect | ||
sigs.k8s.io/kustomize/kyaml v0.15.0 // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect | ||
sigs.k8s.io/yaml v1.4.0 // indirect | ||
) |
Oops, something went wrong.