Compare commits

..

No commits in common. "master" and "v0.1.0" have entirely different histories.

7 changed files with 21 additions and 49 deletions

View File

@ -9,16 +9,13 @@ on:
jobs: jobs:
unittest: unittest:
runs-on: ${{ matrix.os }} runs-on:
strategy: - ubuntu-latest
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps: steps:
- uses: actions/checkout@v4.2.2 - 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: stable
- env: - env:
GOPROXY: ${{ vars.GOPROXY }} GOPROXY: ${{ vars.GOPROXY }}
run: make test/unit run: make test/unit

View File

@ -1,27 +0,0 @@
name: Golang CI lint
on:
pull_request:
types: [ "opened", "reopened", "synchronize" ]
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
permissions:
contents: read
jobs:
golangci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [ stable ]
os: [ ubuntu-latest-amd64, ubuntu-latest-arm64 ]
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.5.0
with:
go-version: ${{ matrix.go }}
- uses: golangci/golangci-lint-action@v8.0.0
with:
version: v2.1

View File

@ -1,18 +1,20 @@
name: 'Lint Markdown files' name: Markdown linter
on: on:
pull_request: pull_request:
types: [ "opened", "reopened", "synchronize" ] types: [ "opened", "reopened", "synchronize" ]
push: push:
branches: [ '*' ] branches: [ '**' ]
tags-ignore: [ '*' ] tags-ignore: [ '**' ]
workflow_dispatch: {}
jobs: jobs:
markdown-lint: markdown-lint:
container:
image: git.cryptic.systems/volker.raschek/markdownlint:0.45.0
runs-on: runs-on:
- ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@v19.1.0 - name: Lint Markdown files
with: run: markdownlint --config .markdownlint.yaml .
globs: '**/*.md'

2
go.mod
View File

@ -2,7 +2,7 @@ module git.cryptic.systems/volker.raschek/civ
go 1.24 go 1.24
toolchain go1.24.4 toolchain go1.24.3
require ( require (
git.cryptic.systems/volker.raschek/dockerutils v0.2.0 git.cryptic.systems/volker.raschek/dockerutils v0.2.0

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

@ -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 {