Skip to content

Commit

Permalink
Collecting webhooks configurations and adding goreleaser yaml. (#2)
Browse files Browse the repository at this point in the history
* Collecting webhooks configurations.
* Add GitHub action goreleaser
  • Loading branch information
tanmayja authored May 19, 2023
1 parent 0ac4061 commit 2e88d5a
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 107 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- 'v*.*.*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
34 changes: 34 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
project_name: akoctl
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
binary: akoctl

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
akoctl_{{ .Tag }}_{{ .Os }}_{{ .Arch -}}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
skip: true
release:
prerelease: true
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,14 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: build
build:
go build -o bin/akoctl main.go
go build -o bin/akoctl main.go

.PHONY: goreleaser-install
goreleaser-install: $(LOCALBIN)
GOBIN=$(LOCALBIN) go install github.com/goreleaser/goreleaser@latest

.PHONY: gorelease
gorelease: goreleaser-install
$(LOCALBIN)/goreleaser release --snapshot --clean
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This command collects the following data from the specified namespaces:
Additionally, the following cluster-wide data points are collected:
* Storage class objects.
* Configurations of all nodes in the kubernetes cluster.
* Configurations of aerospike mutating and validating webhooks.

### Result Format

Expand All @@ -57,6 +58,9 @@ akoctl_collectinfo
│   │   └── <node2 name>.yaml
│   └── storageclasses
│   ├── <storageclass name>.yaml
│   └── webhooks
│   ├── <mutatingwebhook name>.yaml
│   ├── <validatingwebhook name>.yaml
└── k8s_namespaces
└── aerospike
├── aerospikeclusters
Expand Down
3 changes: 2 additions & 1 deletion cmd/collectinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ var collectinfoCmd = &cobra.Command{
Use: "collectinfo",
Short: "collectinfo command collects all the required info from kubernetes cluster",
Long: `This command collects the following data from the given namespaces:
* pods, statefulsets, persistentvolumeclaims, aerospikeclusters, nodes, storageclasses objects .
* pods, statefulsets, persistentvolumeclaims, aerospikeclusters, nodes, storageclasses objects.
* mutating and validating webhooks configurations.
* containers logs.
* events logs.`,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
46 changes: 23 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ module github.com/aerospike/aerospike-kubernetes-operator-ctl
go 1.19

require (
github.com/onsi/ginkgo/v2 v2.9.2
github.com/onsi/gomega v1.27.4
github.com/spf13/cobra v1.6.1
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.6
github.com/spf13/cobra v1.7.0
go.uber.org/zap v1.24.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.27.1
k8s.io/apiextensions-apiserver v0.26.2
k8s.io/apiextensions-apiserver v0.27.1
k8s.io/apimachinery v0.27.1
k8s.io/cli-runtime v0.27.1
k8s.io/client-go v0.27.1
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a
sigs.k8s.io/controller-runtime v0.14.5
k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5
sigs.k8s.io/controller-runtime v0.14.6
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // 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.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -38,7 +38,7 @@ require (
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/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // 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
Expand All @@ -50,24 +50,24 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.13.2 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect
sigs.k8s.io/kustomize/api v0.13.4 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 2e88d5a

Please sign in to comment.