Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/workflows/changie-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
CHANGIE_BODY: ${{ github.event.workflow_run.display_title }}
shell: bash
run: |
go install github.com/miniscruff/changie@v1.23.0
changie new --kind Dependency --body "$CHANGIE_BODY"
go tool changie new --kind Dependency --body "$CHANGIE_BODY"

- name: Commit & Push changes
if: >-
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ jobs:
then
echo "Skip Changie..."
else
go install github.com/miniscruff/changie@latest
changie batch ${{ steps.version.outputs.RELEASE_VERSION }}
changie merge
go tool changie batch ${{ steps.version.outputs.RELEASE_VERSION }}
go tool changie merge
git add .
git commit -m "Cut Release '${{ steps.version.outputs.RELEASE_VERSION }}'"
git push origin HEAD
Expand Down
54 changes: 4 additions & 50 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ tasks:
cmds:
- task: brew-install-go
- task: brew-install-jq
- task: install-changie
- task: install-gofumpt
- task: install-golangci-lint

lint:
desc: Formatting and linting
cmds:
- test -z "$(gofumpt -d -e . | tee /dev/stderr)"
- golangci-lint run --timeout 5m
- test -z "$(go tool gofumpt -d -e . | tee /dev/stderr)"
- go tool golangci-lint run --timeout 5m

fix:
desc: Fix formatting and linting
cmds:
- gofumpt -w .
- go tool gofumpt -w .
- go mod tidy
- golangci-lint run --timeout 5m --fix
- go tool golangci-lint run --timeout 5m --fix

deps:
desc: Update dependencies
Expand Down Expand Up @@ -68,46 +65,3 @@ tasks:
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "jq"- see https://brew.sh'

go-install-tool:
desc: go install '{{.GO_TOOL}}' and set GOBIN if not set
internal: true
silent: true
vars:
IS_TOOL_INSTALLED:
sh: which {{.GO_TOOL}} > /dev/null || echo "1"
cmds:
- test -z "{{.IS_TOOL_INSTALLED}}" || echo "Installing {{.GO_TOOL}}..."
- test -z "{{.IS_TOOL_INSTALLED}}" || go install {{.GO_TOOL_PATH}}
- test -n $(go env GOBIN) || go env -w GOBIN=$(go env GOPATH)/bin
- echo " '{{.GO_TOOL}}' is installed."
requires:
vars: [GO_TOOL, GO_TOOL_PATH]

install-changie:
desc: go install "changie"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "changie", GO_TOOL_PATH: "github.com/miniscruff/changie@latest" }

install-delve:
desc: go install "dlv"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "dlv", GO_TOOL_PATH: "github.com/go-delve/delve/cmd/dlv@latest" }

install-gofumpt:
desc: go install "gofumpt"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "gofumpt", GO_TOOL_PATH: "mvdan.cc/gofumpt@latest" }

install-golangci-lint:
desc: go install "golangci-lint"
internal: true
cmds:
- task: go-install-tool
vars: { GO_TOOL: "golangci-lint", GO_TOOL_PATH: "github.com/golangci/golangci-lint/cmd/golangci-lint@latest" }
64 changes: 31 additions & 33 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,38 @@ import (
"opslevel-agent/controller"
)

var (
DefaultConfiguration = &Configuration{
Selectors: []controller.Selector{
{
ApiVersion: "v1",
Kind: "Namespace",
},
{
ApiVersion: "apps/v1",
Kind: "Deployment",
},
{
ApiVersion: "apps/v1",
Kind: "StatefulSet",
},
{
ApiVersion: "apps/v1",
Kind: "DaemonSet",
},
{
ApiVersion: "networking.k8s.io/v1",
Kind: "Ingress",
},
{
ApiVersion: "v1",
Kind: "Service",
},
{
ApiVersion: "batch/v1",
Kind: "CronJob",
},
var DefaultConfiguration = &Configuration{
Selectors: []controller.Selector{
{
ApiVersion: "v1",
Kind: "Namespace",
},
}
)
{
ApiVersion: "apps/v1",
Kind: "Deployment",
},
{
ApiVersion: "apps/v1",
Kind: "StatefulSet",
},
{
ApiVersion: "apps/v1",
Kind: "DaemonSet",
},
{
ApiVersion: "networking.k8s.io/v1",
Kind: "Ingress",
},
{
ApiVersion: "v1",
Kind: "Service",
},
{
ApiVersion: "batch/v1",
Kind: "CronJob",
},
},
}

type Configuration struct {
Selectors []controller.Selector `json:"selectors" yaml:"selectors"`
Expand Down
Loading
Loading