1 Commits

Author SHA1 Message Date
51bf8cba6b chore(deps): update davidanson/markdownlint-cli2-action action to v20
Some checks failed
Golang Tests / unittest (stable, ubuntu-latest-amd64) (push) Successful in 8s
Golang Tests / unittest (stable, ubuntu-latest-amd64) (pull_request) Successful in 7s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (pull_request) Failing after 20s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Golang CI lint / golangci (stable, ubuntu-latest-amd64) (push) Failing after 2m21s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (push) Successful in 42s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (push) Failing after 1m25s
Golang Tests / unittest (stable, ubuntu-latest-arm64) (pull_request) Successful in 44s
Golang CI lint / golangci (stable, ubuntu-latest-arm64) (pull_request) Failing after 1m25s
2025-06-01 11:42:00 +00:00
12 changed files with 50 additions and 81 deletions

View File

@ -1,13 +1,15 @@
# Editor configuration, see http://editorconfig.org # EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true root = true
[*] [*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space indent_style = space
insert_final_newline = false indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = false
[{Makefile,*.go}] [Makefile]
indent_style = tab indent_style = tab

View File

@ -1,4 +1,4 @@
name: "Run Golang tests" name: Golang Tests
on: on:
pull_request: pull_request:
@ -6,34 +6,16 @@ on:
push: push:
branches: [ '**' ] branches: [ '**' ]
tags-ignore: [ '**' ] tags-ignore: [ '**' ]
workflow_dispatch: {}
jobs: jobs:
# integration-test: unittest:
# name: "Run integration tests"
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# go: [ stable ]
# os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
# steps:
# - uses: actions/checkout@v4.3.0
# - uses: actions/setup-go@v5.5.0
# with:
# go-version: ${{ matrix.go }}
# - env:
# GOPROXY: ${{ vars.GOPROXY }}
# run: make test/integration
unit-test:
name: "Run unit tests"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
go: [ stable ] go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ] os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps: steps:
- uses: actions/checkout@v4.3.0 - uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0 - uses: actions/setup-go@v5.5.0
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}

View File

@ -1,4 +1,4 @@
name: "Lint Golang files" name: Golang CI lint
on: on:
pull_request: pull_request:
@ -6,24 +6,22 @@ on:
push: push:
branches: [ '**' ] branches: [ '**' ]
tags-ignore: [ '**' ] tags-ignore: [ '**' ]
workflow_dispatch: {}
permissions: permissions:
contents: read contents: read
jobs: jobs:
golangci: golangci:
name: "Run golang CI linter"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
go: [ stable ] go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ] os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps: steps:
- uses: actions/checkout@v4.3.0 - uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0 - uses: actions/setup-go@v5.5.0
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- uses: golangci/golangci-lint-action@v8.0.0 - uses: golangci/golangci-lint-action@v8.0.0
with: with:
version: v2.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint version: v2.1

View File

@ -1,4 +1,4 @@
name: "Lint Markdown files" name: 'Lint Markdown files'
on: on:
pull_request: pull_request:
@ -6,14 +6,13 @@ on:
push: push:
branches: [ '*' ] branches: [ '*' ]
tags-ignore: [ '*' ] tags-ignore: [ '*' ]
workflow_dispatch: {}
jobs: jobs:
markdown-lint: markdown-lint:
name: "Run markdown linter" runs-on:
runs-on: ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.3.0 - uses: actions/checkout@v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0 - uses: DavidAnson/markdownlint-cli2-action@v20.0.0
with: with:
globs: '**/*.md' globs: '**/*.md'

View File

@ -1,4 +1,4 @@
name: "Release" name: Release
on: on:
push: push:
@ -9,15 +9,15 @@ permissions:
jobs: jobs:
release: release:
name: "Release application" runs-on:
runs-on: ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.3.0 - uses: actions/checkout@v4.2.2
- uses: docker/setup-qemu-action@v3.6.0 - uses: docker/setup-qemu-action@v3.6.0
- uses: actions/setup-go@v5.5.0 - uses: actions/setup-go@v5.5.0
with: with:
go-version: stable go-version: stable
- uses: docker/login-action@v3.5.0 - uses: docker/login-action@v3.4.0
with: with:
registry: git.cryptic.systems registry: git.cryptic.systems
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
@ -26,9 +26,9 @@ jobs:
GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} GITEA_TOKEN: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
GONOSUMDB: ${{ vars.GONOSUMDB }} GONOSUMDB: ${{ vars.GONOSUMDB }}
GOPROXY: ${{ vars.GOPROXY }} GOPROXY: ${{ vars.GOPROXY }}
uses: goreleaser/goreleaser-action@v6.4.0 uses: goreleaser/goreleaser-action@v6.3.0
with: with:
version: v2.11.2 # renovate: datasource=github-releases depName=goreleaser/goreleaser version: "~> v2"
args: release --clean args: release --clean
sync-to-hub-docker-io: sync-to-hub-docker-io:

View File

@ -8,9 +8,10 @@ on:
jobs: jobs:
update-description-on-hub-docker-io: update-description-on-hub-docker-io:
runs-on: ubuntu-latest runs-on:
- ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.3.0 - uses: actions/checkout@v4.2.2
- uses: peter-evans/dockerhub-description@v4.0.2 - uses: peter-evans/dockerhub-description@v4.0.2
with: with:
username: ${{ secrets.DOCKER_IO_USERNAME }} username: ${{ secrets.DOCKER_IO_USERNAME }}

View File

@ -1,13 +0,0 @@
version: "2"
linters:
default: standard
enable:
- errname
- gosec
exclusions:
rules: []
warn-unused: true
run:
tests: true

8
go.mod
View File

@ -2,12 +2,12 @@ module git.cryptic.systems/volker.raschek/civ
go 1.24 go 1.24
toolchain go1.25.1 toolchain go1.24.3
require ( require (
git.cryptic.systems/volker.raschek/dockerutils v0.2.0 git.cryptic.systems/volker.raschek/dockerutils v0.2.0
github.com/Masterminds/semver/v3 v3.4.0 github.com/Masterminds/semver/v3 v3.3.1
github.com/spf13/cobra v1.10.1 github.com/spf13/cobra v1.9.1
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
) )
@ -25,7 +25,7 @@ require (
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 // indirect github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.9 // indirect github.com/spf13/pflag v1.0.6 // indirect
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect

12
go.sum
View File

@ -5,8 +5,8 @@ git.cryptic.systems/volker.raschek/dockerutils v0.2.0/go.mod h1:c4ZZpD2unnzwr7qH
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
@ -103,11 +103,11 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=

View File

@ -5,5 +5,5 @@ import "git.cryptic.systems/volker.raschek/civ/cmd"
var version string var version string
func main() { func main() {
_ = cmd.Execute(version) cmd.Execute(version)
} }

View File

@ -65,7 +65,7 @@ func (jr *JSONReader) ReadFile() (*domain.Config, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer func() { _ = f.Close() }() defer f.Close()
return jr.read(f) return jr.read(f)
} }
@ -79,7 +79,7 @@ func (jw *JSONWriter) WriteFile(config *domain.Config) error {
if err != nil { if err != nil {
return err return err
} }
defer func() { _ = f.Close() }() defer func() { f.Close() }()
return jw.write(f, config) return jw.write(f, config)
} }
@ -103,7 +103,7 @@ func (yr *YAMLReader) ReadFile() (*domain.Config, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer func() { _ = f.Close() }() defer f.Close()
return yr.read(f) return yr.read(f)
} }
@ -129,7 +129,7 @@ func (yw *YAMLWriter) WriteFile(config *domain.Config) error {
if err != nil { if err != nil {
return err return err
} }
defer func() { _ = f.Close() }() defer func() { f.Close() }()
return yw.write(f, config) return yw.write(f, config)
} }

View File

@ -182,7 +182,7 @@ func labelCompareSemver(compareSemver *domain.LabelConstraintCompareSemver, pars
} }
func labelCompareString(compareString *domain.LabelConstraintCompareString, labelValue string) bool { func labelCompareString(compareString *domain.LabelConstraintCompareString, labelValue string) bool {
var majorState = true var majorState bool = true
// Equal // Equal
if compareString.Equal != "" { if compareString.Equal != "" {
@ -224,7 +224,7 @@ func labelCompareString(compareString *domain.LabelConstraintCompareString, labe
} }
func labelCount(re *regexp.Regexp, labelConstraintCounter *domain.LabelConstraintCounter, labels map[string]string) bool { func labelCount(re *regexp.Regexp, labelConstraintCounter *domain.LabelConstraintCounter, labels map[string]string) bool {
var majorState = true var majorState bool = true
var i uint = 0 var i uint = 0
for key := range labels { for key := range labels {