Skip to content

Commit

Permalink
Add Kubernetes package with wait logic
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba committed Jun 5, 2024
1 parent ba8cb25 commit 1730473
Show file tree
Hide file tree
Showing 7 changed files with 603 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check-kubernetes.yaml
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 }}
60 changes: 60 additions & 0 deletions .github/workflows/release-kubernetes.yaml
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
65 changes: 65 additions & 0 deletions kubernetes/go.mod
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.19.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // 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
)
Loading

0 comments on commit 1730473

Please sign in to comment.