61 Commits

Author SHA1 Message Date
b45f8181aa style(lint): block unused parameter
All checks were successful
continuous-integration/drone/push Build is passing
2025-02-20 17:26:43 +01:00
13301cb367 fix(dockerCompose): add further methods of port
This patch adds the following methods:

ports.ExistsDstIP()
ports.ExistsDstPort()
ports.ExistsProtocol()
ports.ExistsSrcIP()
ports.ExistsSrcPort()
ports.GetDstIP()
ports.GetDstPort()
ports.GetProtocol()
ports.GetSrcIP()
ports.GetSrcPort()
2025-02-20 17:26:43 +01:00
0a68b2d8e7 fix(dockerCompose): add port.ExistProtocol 2025-02-20 17:26:43 +01:00
54af4469a4 chore(deps): update docker.io/plugins/docker docker tag to v20.18.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-18 08:08:41 +00:00
dc15512229 chore(deps): update module github.com/spf13/cobra to v1.9.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-17 02:10:59 +00:00
5fa0991bc2 chore(deps): update docker.io/library/golang docker tag to v1.24.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-15 23:09:33 +00:00
efb5fba9a9 chore(deps): update module github.com/spf13/cobra to v1.9.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-15 20:12:23 +00:00
c8894de28c chore(deps): update docker.io/library/golang docker tag to v1.23.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-05 23:22:50 +00:00
da34769ff3 chore(deps): update docker.io/library/golang docker tag to v1.23.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-17 02:09:57 +00:00
1a9fa39c94 chore(deps): update docker.io/plugins/docker docker tag to v20.18.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-25 05:07:40 +00:00
554c73bd7b chore(deps): update docker.io/library/golang docker tag to v1.23.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 05:06:28 +00:00
ea0bb14ac4 chore(deps): update docker.io/library/alpine docker tag to v3.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-05 23:07:30 +00:00
20b4f12dd1 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.43.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-03 14:10:12 +00:00
f2dc3d5174 fix(fetcher): handle all os.Stat() errors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-12-03 11:09:38 +01:00
37de3302c6 chore(deps): update docker.io/plugins/docker docker tag to v20.18.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-29 11:08:17 +00:00
57dff5ff36 chore(deps): update git.cryptic.systems/volker.raschek/git docker tag to v1.4.0
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2024-11-25 23:08:50 +00:00
f0f5e586d9 chore(deps): update module github.com/stretchr/testify to v1.10.0
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2024-11-23 14:06:33 +00:00
0cd81642bb chore(deps): update quay.io/skopeo/stable docker tag to v1.17.0
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build encountered an error
2024-11-21 17:08:04 +00:00
e6e3b0d4fc chore(deps): update docker.io/library/golang docker tag to v1.23.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-07 08:06:11 +00:00
e66b2045f2 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.42.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-14 19:09:18 +00:00
141779c2a0 chore(deps): update docker.io/library/golang docker tag to v1.23.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-02 01:07:01 +00:00
c2ad246c32 chore(deps): update docker.io/library/golang docker tag to v1.23.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-06 01:06:09 +00:00
e1a7f3b900 chore(deps): update quay.io/skopeo/stable docker tag to v1.16.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-09-03 16:06:24 +00:00
5417844dcc chore(deps): update docker.io/plugins/docker docker tag to v20.18.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-22 16:06:40 +00:00
63030b3523 chore(deps): update docker.io/library/golang docker tag to v1.23.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-18 19:08:04 +00:00
168026c4ac chore(deps): update quay.io/skopeo/stable docker tag to v1.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-08-18 16:07:00 +00:00
992941abdc chore(deps): update docker.io/plugins/docker docker tag to v20.18.3
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-07-26 12:03:46 +00:00
e8093e7266 chore(deps): update docker.io/plugins/docker docker tag to v20.18.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-23 19:09:28 +00:00
a04c5f9606 chore(deps): update quay.io/skopeo/stable docker tag to v1.15.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-16 16:05:39 +00:00
7edd465bc6 chore(deps): update docker.io/plugins/docker docker tag to v20.18.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-15 22:07:28 +00:00
c62c747551 chore(deps): update quay.io/skopeo/stable docker tag to v1.15.1
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-07-13 22:04:55 +00:00
900e5535ed chore(deps): update module github.com/spf13/cobra to v1.8.1
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-13 20:04:40 +00:00
dc329229e1 chore(deps): update docker.io/library/golang docker tag to v1.22.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-13 19:06:30 +00:00
49b1cfb1fe chore(deps): update docker.io/plugins/docker docker tag to v20.18.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-07-13 10:54:03 +00:00
910172cc94 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.41.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-27 13:09:43 +00:00
04455e02b4 chore(deps): update docker.io/library/alpine docker tag to v3.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-22 19:05:46 +00:00
e2c38f76b7 chore(deps): update docker.io/plugins/docker docker tag to v20.17.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-20 13:08:10 +00:00
4c67cb4198 chore(deps): update docker.io/plugins/docker docker tag to v20.17.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-13 10:05:49 +00:00
5c3ba383b6 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.40.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-05-07 22:12:31 +00:00
bbade1e4f9 chore(deps): update docker.io/library/golang docker tag to v1.22.3
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-05-07 19:05:10 +00:00
4085619557 chore(deps): update docker.io/library/golang docker tag to v1.22.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-04-03 19:43:35 +00:00
a1b8695aae chore(deps): update quay.io/skopeo/stable docker tag to v1.15.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-31 16:06:08 +00:00
934997b20a chore(deps): update docker.io/plugins/docker docker tag to v20.17.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-11 08:06:06 +00:00
702c1ac4b6 chore(deps): update docker.io/library/golang docker tag to v1.22.1
Some checks reported errors
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build was killed
2024-03-05 20:04:44 +00:00
ea5269027d chore(deps): update module github.com/stretchr/testify to v1.9.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-03-02 14:04:47 +00:00
6ced20b951 fix(ci): update renovate config
All checks were successful
continuous-integration/drone/push Build is passing
2024-03-02 13:42:00 +01:00
a6b4fd0afc chore(deps): update quay.io/skopeo/stable docker tag to v1.14.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-18 17:05:17 +00:00
07288bf752 chore(deps): update docker.io/library/golang docker tag to v1.22.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-02-07 05:03:55 +00:00
e09eaebfb3 chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.39.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-28 23:05:04 +00:00
6224a9d38f chore(deps): update docker.io/library/alpine docker tag to v3.19.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-01-27 02:03:49 +00:00
2da0b01a44 fix(renovate): remove automerge options
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-21 15:03:05 +01:00
7628004096 Merge pull request 'chore(deps): update docker.io/plugins/docker docker tag to v20.17.2' (#27) from renovate/docker.io-plugins-docker-20.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-10 17:15:47 +00:00
19f70937e9 chore(deps): update docker.io/plugins/docker docker tag to v20.17.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-10 17:05:37 +00:00
d8e064d873 Merge pull request 'chore(deps): update docker.io/library/golang docker tag to v1.21.6' (#26) from renovate/docker.io-library-golang-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-09 23:16:54 +00:00
7cb4c5634c chore(deps): update docker.io/library/golang docker tag to v1.21.6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-01-09 23:04:40 +00:00
86695b62ec Merge pull request 'chore(deps): update docker.io/library/alpine docker tag to v3.19.0' (#24) from renovate/docker.io-library-alpine-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #24
2023-12-20 11:16:03 +00:00
dc861f13b1 chore(deps): update docker.io/library/alpine docker tag to v3.19.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-12-13 17:43:44 +00:00
9a3c64e91a chore(deps): update git.cryptic.systems/volker.raschek/markdownlint docker tag to v0.38.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-09 14:33:36 +00:00
610dd87a4b chore(deps): update quay.io/skopeo/stable docker tag to v1.14.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-06 17:17:51 +01:00
165cd6a778 chore(deps): update docker.io/library/alpine docker tag to v3.18.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-06 02:03:16 +01:00
2f9a7d0dd5 chore(deps): update docker.io/library/golang docker tag to v1.21.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-12-05 23:05:16 +00:00
8 changed files with 624 additions and 59 deletions

View File

@ -11,12 +11,12 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: markdown lint - name: markdown lint
commands: commands:
- markdownlint *.md - markdownlint *.md
image: git.cryptic.systems/volker.raschek/markdownlint:0.37.0 image: git.cryptic.systems/volker.raschek/markdownlint:0.43.0
resources: resources:
limits: limits:
cpu: 150 cpu: 150
@ -62,12 +62,12 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: unit-test - name: unit-test
commands: commands:
- go test -v ./... - go test -v ./...
image: docker.io/library/golang:1.21.4 image: docker.io/library/golang:1.24.0
trigger: trigger:
event: event:
@ -87,12 +87,12 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: unit-test - name: unit-test
commands: commands:
- go test -v ./... - go test -v ./...
image: docker.io/library/golang:1.21.4 image: docker.io/library/golang:1.24.0
trigger: trigger:
event: event:
@ -120,10 +120,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -187,10 +187,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -254,10 +254,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -319,10 +319,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: false auto_tag: false
dockerfile: Dockerfile dockerfile: Dockerfile
@ -385,7 +385,7 @@ node_selector:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build-manifest - name: build-manifest
image: docker.io/plugins/manifest:1.4.0 image: docker.io/plugins/manifest:1.4.0
@ -442,7 +442,7 @@ depends_on:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: latest-sync - name: latest-sync
commands: commands:
@ -456,7 +456,7 @@ steps:
from_secret: container_image_registry_user from_secret: container_image_registry_user
DEST_CRED_PASSWORD: DEST_CRED_PASSWORD:
from_secret: container_image_registry_password from_secret: container_image_registry_password
image: quay.io/skopeo/stable:v1.13.3 image: quay.io/skopeo/stable:v1.17.0
- name: email-notification - name: email-notification
environment: environment:
@ -503,10 +503,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: amd64 auto_tag_suffix: amd64
@ -563,10 +563,10 @@ platform:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build - name: build
image: docker.io/plugins/docker:20.17.1 image: docker.io/plugins/docker:20.18.7
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: arm64-v8 auto_tag_suffix: arm64-v8
@ -628,7 +628,7 @@ node_selector:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: build-manifest - name: build-manifest
image: docker.io/plugins/manifest:1.4.0 image: docker.io/plugins/manifest:1.4.0
@ -682,7 +682,7 @@ depends_on:
steps: steps:
- name: clone - name: clone
image: git.cryptic.systems/volker.raschek/git:1.3.1 image: git.cryptic.systems/volker.raschek/git:1.4.0
- name: tagged-sync - name: tagged-sync
commands: commands:
@ -696,7 +696,7 @@ steps:
from_secret: container_image_registry_user from_secret: container_image_registry_user
DEST_CRED_PASSWORD: DEST_CRED_PASSWORD:
from_secret: container_image_registry_password from_secret: container_image_registry_password
image: quay.io/skopeo/stable:v1.13.3 image: quay.io/skopeo/stable:v1.17.0
- name: email-notification - name: email-notification
environment: environment:

View File

@ -1,4 +1,4 @@
FROM docker.io/library/golang:1.21.4-alpine3.18 AS build FROM docker.io/library/golang:1.23.4-alpine3.19 AS build
RUN apk add git make RUN apk add git make
@ -10,7 +10,7 @@ RUN make install \
PREFIX=/usr \ PREFIX=/usr \
VERSION=${VERSION} VERSION=${VERSION}
FROM docker.io/library/alpine:3.18.4 FROM docker.io/library/alpine:3.21
COPY --from=build /cache / COPY --from=build /cache /

6
go.mod
View File

@ -3,8 +3,8 @@ module git.cryptic.systems/volker.raschek/dcmerge
go 1.20 go 1.20
require ( require (
github.com/spf13/cobra v1.8.0 github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.8.4 github.com/stretchr/testify v1.10.0
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
) )
@ -12,6 +12,6 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

14
go.sum
View File

@ -1,4 +1,4 @@
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@ -6,12 +6,12 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

View File

@ -2,6 +2,7 @@ package dockerCompose
import ( import (
"fmt" "fmt"
"regexp"
"strings" "strings"
) )
@ -559,7 +560,7 @@ func (s *Service) ExistsLabel(name string) bool {
// ExistsPort returns true if the port definition is already present. // ExistsPort returns true if the port definition is already present.
func (s *Service) ExistsPort(src string, dest string, protocol string) bool { func (s *Service) ExistsPort(src string, dest string, protocol string) bool {
for _, port := range s.Ports { for _, port := range s.Ports {
s, d, p := splitStringInPort(port) s, d, p := splitStringInPortMapping(port)
if s == src && d == dest && p == protocol { if s == src && d == dest && p == protocol {
return true return true
} }
@ -571,7 +572,7 @@ func (s *Service) ExistsPort(src string, dest string, protocol string) bool {
// ExistsDestinationPort returns true if the destination port is already used. // ExistsDestinationPort returns true if the destination port is already used.
func (s *Service) ExistsDestinationPort(dest string) bool { func (s *Service) ExistsDestinationPort(dest string) bool {
for _, port := range s.Ports { for _, port := range s.Ports {
_, d, _ := splitStringInPort(port) _, d, _ := splitStringInPortMapping(port)
if d == dest { if d == dest {
return true return true
} }
@ -583,7 +584,7 @@ func (s *Service) ExistsDestinationPort(dest string) bool {
// ExistsSourcePort returns true if the source port is already used. // ExistsSourcePort returns true if the source port is already used.
func (s *Service) ExistsSourcePort(src string) bool { func (s *Service) ExistsSourcePort(src string) bool {
for _, port := range s.Ports { for _, port := range s.Ports {
s, _, _ := splitStringInPort(port) s, _, _ := splitStringInPortMapping(port)
if s == src { if s == src {
return true return true
} }
@ -860,7 +861,7 @@ func (s *Service) mergeExistingWinPorts(ports []string) {
continue continue
} }
src, dest, protocol := splitStringInPort(port) src, dest, protocol := splitStringInPortMapping(port)
if !s.ExistsDestinationPort(dest) { if !s.ExistsDestinationPort(dest) {
s.SetPort(src, dest, protocol) s.SetPort(src, dest, protocol)
} }
@ -1056,7 +1057,7 @@ func (s *Service) mergeLastWinPorts(ports []string) {
continue continue
} }
src, dest, protocol := splitStringInPort(port) src, dest, protocol := splitStringInPortMapping(port)
s.SetPort(src, dest, protocol) s.SetPort(src, dest, protocol)
} }
} }
@ -1138,7 +1139,7 @@ func (s *Service) RemoveLabel(name string) {
func (s *Service) RemovePort(dest string) { func (s *Service) RemovePort(dest string) {
ports := make([]string, 0) ports := make([]string, 0)
for _, port := range s.Ports { for _, port := range s.Ports {
srcPort, destPort, protocol := splitStringInPort(port) srcPort, destPort, protocol := splitStringInPortMapping(port)
switch { switch {
case destPort == dest && len(protocol) <= 0: case destPort == dest && len(protocol) <= 0:
@ -1897,7 +1898,7 @@ func (v *Volume) MergeLastWin(volume *Volume) {
} }
} }
func (v *Volume) mergeExistingWinExternal(external bool) { func (v *Volume) mergeExistingWinExternal(_ bool) {
if v.External { if v.External {
return return
} }
@ -1950,17 +1951,33 @@ func splitStringInKeyValue(s, sep string) (string, string) {
return key, value return key, value
} }
func splitStringInPort(s string) (string, string, string) { // splitStringInPortMapping parses a string and returns the src, dest port including an optional protocol.
parts := strings.Split(s, portDelimiter) //
src := parts[0] // // Example
rest := parts[1] // s, d, p := splitStringInPortMapping("80:80/tcp")
// // Output: "80" "80" "tcp"
// s, d, p := splitStringInPortMapping("0.0.0.0:80:80/tcp")
// // Output: "0.0.0.0:80" "80" "tcp"
func splitStringInPortMapping(s string) (string, string, string) {
p := port(s)
parts = strings.Split(rest, portProtocolDelimiter) var src string
if len(parts) == 2 { switch {
return src, parts[0], parts[1] case p.existsSrcIP() && p.existsSrcPort():
src = fmt.Sprintf("%s:%s", p.getSrcIP(), p.getSrcPort())
case !p.existsSrcIP():
src = p.getSrcPort()
} }
return src, parts[0], "" var dst string
switch {
case p.existsDstIP() && p.existsDstPort():
dst = fmt.Sprintf("%s:%s", p.getDstIP(), p.getDstPort())
case !p.existsDstIP():
dst = p.getDstPort()
}
return src, dst, p.getProtocol()
} }
func splitStringInVolume(s string) (string, string, string) { func splitStringInVolume(s string) (string, string, string) {
@ -1973,3 +1990,131 @@ func splitStringInVolume(s string) (string, string, string) {
} }
return src, dest, "" return src, dest, ""
} }
var (
regExpPort = regexp.MustCompile(`^((?<srcIP>([\d]{1,3}\.){3}[\d]{1,3}):)?(?<srcPort>[\d]{1,5}):((?<dstIP>([\d]{1,3}\.){3}[\d]{1,3}):)?(?<dstPort>[\d]{1,5})(\/(?<protocol>[a-z]*))?$`)
)
type port string
// existsDstPort returns true, if the port string contains a trailing destination port definition.
func (p port) existsDstPort() bool {
return len(p.getDstPort()) > 0
}
// existsDstIP returns true, if the port string contains a trailing destination ip definition.
func (p port) existsDstIP() bool {
return len(p.getDstIP()) > 0
}
// existsProtocol returns true, if the port string contains a protocol definition.
func (p port) existsProtocol() bool {
return len(p.getProtocol()) > 0
}
// existsSrcIP returns true, if the port string contains a leading src ip definition.
func (p port) existsSrcIP() bool {
return len(p.getSrcIP()) > 0
}
// existsSrcPort returns true, if the port string contains a leading src port definition.
func (p port) existsSrcPort() bool {
return len(p.getSrcPort()) > 0
}
// getDst returns the concatenation of the destination ip and port. If the destination ip is empty, only the port will
// be returned.
func (p port) getDst() string {
switch {
case p.existsDstIP():
return fmt.Sprintf("%s%s%s", p.getDstIP(), portDelimiter, p.getDstPort())
default:
return p.getDstPort()
}
}
// getSrcIP returns the destination ip, if the port string contains a destination ip definition.
func (p port) getDstIP() string {
matches := regExpPort.FindStringSubmatch(string(p))
i := regExpPort.SubexpIndex("dstIP")
switch {
case len(matches) <= 0:
return ""
case i < 0:
return ""
}
return matches[i]
}
// getSrcPort returns the destination port, if the port string contains an destination port definition.
func (p port) getDstPort() string {
matches := regExpPort.FindStringSubmatch(string(p))
i := regExpPort.SubexpIndex("dstPort")
switch {
case len(matches) <= 0:
return ""
case i < 0:
return ""
}
return matches[i]
}
// getProtocol returns the protocol, if the port string contains a protocol definition.
func (p port) getProtocol() string {
matches := regExpPort.FindStringSubmatch(string(p))
i := regExpPort.SubexpIndex("protocol")
switch {
case len(matches) <= 0:
return ""
case i < 0:
return ""
}
return matches[i]
}
// getSrc returns the concatenation of the source ip and port. If the source ip is empty, only the port will be
// returned.
func (p port) getSrc() string {
switch {
case p.existsSrcIP():
return fmt.Sprintf("%s%s%s", p.getSrcIP(), portDelimiter, p.getSrcPort())
default:
return p.getSrcPort()
}
}
// getSrcIP returns the source ip, if the port string contains an src ip definition.
func (p port) getSrcIP() string {
matches := regExpPort.FindStringSubmatch(string(p))
i := regExpPort.SubexpIndex("srcIP")
switch {
case len(matches) <= 0:
return ""
case i < 0:
return ""
}
return matches[i]
}
// getSrcPort returns the source port, if the port string contains an src port definition.
func (p port) getSrcPort() string {
matches := regExpPort.FindStringSubmatch(string(p))
i := regExpPort.SubexpIndex("srcPort")
switch {
case len(matches) <= 0:
return ""
case i < 0:
return ""
}
return matches[i]
}

View File

@ -0,0 +1,418 @@
package dockerCompose
import (
"testing"
"github.com/stretchr/testify/require"
)
func Test_splitStringInPortMapping(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedSrc string
expectedDst string
expectedProtocol string
}{
{
s: "53:53",
expectedSrc: "53",
expectedDst: "53",
expectedProtocol: "",
},
{
s: "0.0.0.0:53:53",
expectedSrc: "0.0.0.0:53",
expectedDst: "53",
expectedProtocol: "",
},
{
s: "0.0.0.0:53:10.11.12.13:53",
expectedSrc: "0.0.0.0:53",
expectedDst: "10.11.12.13:53",
expectedProtocol: "",
},
{
s: "0.0.0.0:53:10.11.12.13:53/tcp",
expectedSrc: "0.0.0.0:53",
expectedDst: "10.11.12.13:53",
expectedProtocol: "tcp",
},
}
for i, testCase := range testCases {
actualSrc, actualDst, actualProtocol := splitStringInPortMapping(testCase.s)
require.Equal(testCase.expectedSrc, actualSrc, "TestCase %v", i)
require.Equal(testCase.expectedDst, actualDst, "TestCase %v", i)
require.Equal(testCase.expectedProtocol, actualProtocol, "TestCase %v", i)
}
}
func TestPort_DstIP(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedBool bool
expectedString string
}{
{
s: "",
expectedBool: false,
expectedString: "",
},
{
s: "53:53",
expectedBool: false,
expectedString: "",
},
{
s: "53:53/tcp",
expectedBool: false,
expectedString: "",
},
{
s: "53:53/udp",
expectedBool: false,
expectedString: "",
},
{
s: "0.0.0.0:53",
expectedBool: false,
expectedString: "",
},
{
s: "53:0.0.0.0:53",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "53:0.0.0.0:53/tcp",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "53:0.0.0.0:53/udp",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "10.11.12.13:53",
expectedBool: false,
expectedString: "",
},
{
s: "53:10.11.12.13:53",
expectedBool: true,
expectedString: "10.11.12.13",
},
{
s: "53:10.11.12.13:53/tcp",
expectedBool: true,
expectedString: "10.11.12.13",
},
{
s: "53:10.11.12.13:53/udp",
expectedBool: true,
expectedString: "10.11.12.13",
},
}
for i, testCase := range testCases {
p := port(testCase.s)
require.Equal(testCase.expectedBool, p.existsDstIP(), "TestCase %v", i)
require.Equal(testCase.expectedString, p.getDstIP(), "TestCase %v", i)
}
}
func TestPort_DstPort(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedBool bool
expectedString string
}{
{
s: "",
expectedBool: false,
expectedString: "",
},
{
s: "53:53",
expectedBool: true,
expectedString: "53",
},
{
s: "53:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:53/udp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:0.0.0.0:53",
expectedBool: true,
expectedString: "53",
},
{
s: "53:0.0.0.0:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:0.0.0.0:53/udp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:10.11.12.13:53",
expectedBool: true,
expectedString: "53",
},
{
s: "53:10.11.12.13:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:10.11.12.13:53/udp",
expectedBool: true,
expectedString: "53",
},
}
for i, testCase := range testCases {
p := port(testCase.s)
require.Equal(testCase.expectedBool, p.existsDstPort(), "TestCase %v", i)
require.Equal(testCase.expectedString, p.getDstPort(), "TestCase %v", i)
}
}
func TestPort_Protocol(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedBool bool
expectedString string
}{
{
s: "0",
expectedBool: false,
expectedString: "",
},
{
s: "53/tcp",
expectedBool: false,
expectedString: "",
},
{
s: "53/udp",
expectedBool: false,
expectedString: "",
},
{
s: "53:53",
expectedBool: false,
expectedString: "",
},
{
s: "53:53/tcp",
expectedBool: true,
expectedString: "tcp",
},
{
s: "53:53/udp",
expectedBool: true,
expectedString: "udp",
},
{
s: "0.0.0.0:53:53/tcp",
expectedBool: true,
expectedString: "tcp",
},
{
s: "0.0.0.0:53:53/udp",
expectedBool: true,
expectedString: "udp",
},
{
s: "0.0.0.0:53:53/tcp",
expectedBool: true,
expectedString: "tcp",
},
{
s: "0.0.0.0:53:11.12.13.14:53/tcp",
expectedBool: true,
expectedString: "tcp",
},
{
s: "0.0.0.0:53:11.12.13.14:53/udp",
expectedBool: true,
expectedString: "udp",
},
}
for i, testCase := range testCases {
p := port(testCase.s)
require.Equal(testCase.expectedBool, p.existsProtocol(), "TestCase %v", i)
require.Equal(testCase.expectedString, p.getProtocol(), "TestCase %v", i)
}
}
func TestPort_SrcIP(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedBool bool
expectedString string
}{
{
s: "",
expectedBool: false,
expectedString: "",
},
{
s: "53:53",
expectedBool: false,
expectedString: "",
},
{
s: "53:53/tcp",
expectedBool: false,
expectedString: "",
},
{
s: "53:53/udp",
expectedBool: false,
expectedString: "",
},
{
s: "0.0.0.0:53",
expectedBool: false,
expectedString: "",
},
{
s: "0.0.0.0:53:53",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "0.0.0.0:53:53/tcp",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "0.0.0.0:53:53/udp",
expectedBool: true,
expectedString: "0.0.0.0",
},
{
s: "10.11.12.13:53",
expectedBool: false,
expectedString: "",
},
{
s: "10.11.12.13:53:53",
expectedBool: true,
expectedString: "10.11.12.13",
},
{
s: "10.11.12.13:53:53/tcp",
expectedBool: true,
expectedString: "10.11.12.13",
},
{
s: "10.11.12.13:53:53/udp",
expectedBool: true,
expectedString: "10.11.12.13",
},
}
for i, testCase := range testCases {
p := port(testCase.s)
require.Equal(testCase.expectedBool, p.existsSrcIP(), "TestCase %v", i)
require.Equal(testCase.expectedString, p.getSrcIP(), "TestCase %v", i)
}
}
func TestPort_SrcPort(t *testing.T) {
require := require.New(t)
testCases := []struct {
s string
expectedBool bool
expectedString string
}{
{
s: "",
expectedBool: false,
expectedString: "",
},
{
s: "53:53",
expectedBool: true,
expectedString: "53",
},
{
s: "53:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "53:53/udp",
expectedBool: true,
expectedString: "53",
},
{
s: "0.0.0.0:53:53",
expectedBool: true,
expectedString: "53",
},
{
s: "0.0.0.0:53:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "0.0.0.0:53:53/udp",
expectedBool: true,
expectedString: "53",
},
{
s: "10.11.12.13:53:53",
expectedBool: true,
expectedString: "53",
},
{
s: "10.11.12.13:53:53/tcp",
expectedBool: true,
expectedString: "53",
},
{
s: "10.11.12.13:53:53/udp",
expectedBool: true,
expectedString: "53",
},
}
for i, testCase := range testCases {
p := port(testCase.s)
require.Equal(testCase.expectedBool, p.existsSrcPort(), "TestCase %v", i)
require.Equal(testCase.expectedString, p.getSrcPort(), "TestCase %v", i)
}
}

View File

@ -75,7 +75,7 @@ func getDockerComposeViaHTTP(url string) (*dockerCompose.Config, error) {
func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) { func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
fileStat, err := os.Stat(name) fileStat, err := os.Stat(name)
switch { switch {
case errors.Is(err, os.ErrNotExist): case err != nil:
return nil, err return nil, err
case fileStat.IsDir(): case fileStat.IsDir():
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name) return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)

View File

@ -1,8 +1,6 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"assignees": [ "volker.raschek" ], "assignees": [ "volker.raschek" ],
"automergeStrategy": "merge-commit",
"automergeType": "pr",
"labels": [ "renovate" ], "labels": [ "renovate" ],
"packageRules": [ "packageRules": [
{ {
@ -17,15 +15,19 @@
"automerge": true, "automerge": true,
"matchBaseBranches": [ "master" ], "matchBaseBranches": [ "master" ],
"matchManagers": [ "dockerfile" ], "matchManagers": [ "dockerfile" ],
"matchUpdateTypes": [ "patch" ] "matchUpdateTypes": [ "minor", "patch" ]
}, },
{ {
"addLabels": [ "renovate/dcmerge", "renovate/automerge" ], "description": "Automatically update minor and patch versions of go modules",
"automerge": false, "addLabels": [ "renovate/gomod", "renovate/automerge" ],
"matchPackageNames": [ "dcmerge" ], "automerge": true,
"matchManagers": [ "regex" ] "matchManagers": [ "gomod" ],
"matchUpdateTypes": [ "minor", "patch" ]
} }
], ],
"postUpdateOptions": [
"gomodTidy"
],
"rebaseLabel": "renovate/rebase", "rebaseLabel": "renovate/rebase",
"rebaseWhen": "behind-base-branch" "rebaseWhen": "behind-base-branch"
} }