You've already forked civ
Compare commits
1 Commits
renovate/a
...
51bf8cba6b
Author | SHA1 | Date | |
---|---|---|---|
51bf8cba6b
|
@ -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
|
@ -1,4 +1,4 @@
|
|||||||
name: "Run Golang tests"
|
name: Golang Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -6,35 +6,17 @@ 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@v6.0.0
|
- uses: actions/setup-go@v5.5.0
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go }}
|
go-version: ${{ matrix.go }}
|
||||||
- env:
|
- env:
|
||||||
|
@ -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@v6.0.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
|
@ -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'
|
@ -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@v6.0.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:
|
||||||
|
@ -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 }}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
version: "2"
|
|
||||||
linters:
|
|
||||||
default: standard
|
|
||||||
enable:
|
|
||||||
- errname
|
|
||||||
- gosec
|
|
||||||
|
|
||||||
exclusions:
|
|
||||||
rules: []
|
|
||||||
warn-unused: true
|
|
||||||
|
|
||||||
run:
|
|
||||||
tests: true
|
|
4
go.mod
4
go.mod
@ -2,11 +2,11 @@ module git.cryptic.systems/volker.raschek/civ
|
|||||||
|
|
||||||
go 1.24
|
go 1.24
|
||||||
|
|
||||||
toolchain go1.25.0
|
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.9.1
|
github.com/spf13/cobra v1.9.1
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -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=
|
||||||
|
2
main.go
2
main.go
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ import (
|
|||||||
// ContainerRuntime is an interface for different container runtimes to return labels
|
// ContainerRuntime is an interface for different container runtimes to return labels
|
||||||
// based on their full qualified container image name. For example:
|
// based on their full qualified container image name. For example:
|
||||||
//
|
//
|
||||||
// imageLabels, err := Load(ctx, "docker.io/library/alpine:latest")
|
// imageLabels, err := Load(ctx, "docker.io/library/alpine:latest")
|
||||||
// imageLabels, err := Load(ctx, "docker.io/library/busybox:latest")
|
// imageLabels, err := Load(ctx, "docker.io/library/busybox:latest")
|
||||||
type ContainerRuntime interface {
|
type ContainerRuntime interface {
|
||||||
GetImageLabels(ctx context.Context, name string) (map[string]string, error)
|
GetImageLabels(ctx context.Context, name string) (map[string]string, error)
|
||||||
}
|
}
|
||||||
@ -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 {
|
||||||
|
Reference in New Issue
Block a user