Skip to content

Commit 7064cff

Browse files
Merge pull request #15 from cobaltcore-dev/logic-to-receive-pushed-date
Fix logic for tags creation date retrieving
2 parents 5b9baf6 + d107ba3 commit 7064cff

8 files changed

Lines changed: 532 additions & 262 deletions

File tree

.github/workflows/checks.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
uses: actions/setup-go@v6
3030
with:
3131
check-latest: true
32-
go-version: 1.26.1
32+
go-version: 1.26.2
3333
- name: Run golangci-lint
3434
uses: golangci/golangci-lint-action@v9
3535
with:
3636
version: latest
3737
- name: Delete pre-installed shellcheck
38-
run: sudo rm -f $(which shellcheck)
38+
run: sudo rm -f "$(which shellcheck)"
3939
- name: Run shellcheck
4040
run: make run-shellcheck
4141
- name: Dependency Licenses Review
@@ -45,7 +45,7 @@ jobs:
4545
env:
4646
CLICOLOR: "1"
4747
- name: Delete typos binary
48-
run: rm typos
48+
run: rm -f typos
4949
- name: Check if source code files have license header
5050
run: make check-addlicense
5151
- name: REUSE Compliance Check

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
check-latest: true
35-
go-version: 1.26.1
35+
go-version: 1.26.2
3636
- name: Build all binaries
3737
run: make build-all
3838
code_coverage:
3939
name: Code coverage report
40-
if: github.event_name == 'pull_request'
40+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
4141
needs:
4242
- test
4343
runs-on: ubuntu-latest
@@ -65,7 +65,7 @@ jobs:
6565
uses: actions/setup-go@v6
6666
with:
6767
check-latest: true
68-
go-version: 1.26.1
68+
go-version: 1.26.2
6969
- name: Run tests and generate coverage report
7070
run: make build/cover.out
7171
- name: Archive code coverage results

.github/workflows/codeql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
check-latest: true
35-
go-version: 1.26.1
35+
go-version: 1.26.2
3636
- name: Initialize CodeQL
3737
uses: github/codeql-action/init@v4
3838
with:

.golangci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ linters:
9191
# Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
9292
- pattern: ^http\.DefaultServeMux$
9393
- pattern: ^http\.Handle(?:Func)?$
94-
- pkg: ^gopkg\.in/square/go-jose\.v2$
94+
- pkg: ^gopkg\.in/square/go-jose\.v2
9595
msg: gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2
96-
- pkg: ^github.com/coreos/go-oidc$
96+
- pkg: ^github\.com/coreos/go-oidc
9797
msg: github.com/coreos/go-oidc depends on gopkg.in/square/go-jose which has CVEs. Replace it with github.com/coreos/go-oidc/v3
98-
- pkg: ^github.com/howeyc/gopass$
98+
- pkg: ^github\.com/howeyc/gopass
9999
msg: github.com/howeyc/gopass is archived, use golang.org/x/term instead
100+
- pkg: ^github\.com/containers/image/v5
101+
msg: github.com/containers/image/v5 is deprecated and was replaced with go.podman.io/image/v5
100102
goconst:
101103
min-occurrences: 5
102104
gocritic:
@@ -130,6 +132,8 @@ linters:
130132
- github.com/mdlayher/arp
131133
# for github.com/sapcc/vpa_butler
132134
- k8s.io/client-go
135+
# for github.com/sapcc/keppel et al
136+
- github.com/go-gorp/gorp/v3
133137
toolchain-forbidden: true
134138
go-version-pattern: 1\.\d+(\.0)?$
135139
gosec:

cloudprofilesync/source.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"encoding/json"
99
"errors"
1010
"strings"
11-
"time"
1211

1312
"golang.org/x/sync/semaphore"
1413
"oras.land/oras-go/v2/registry/remote"
@@ -24,7 +23,6 @@ type Result[T any] struct {
2423
type SourceImage struct {
2524
Version string
2625
Architectures []string
27-
CreatedAt time.Time
2826
}
2927

3028
type Source interface {
@@ -106,21 +104,10 @@ func (o *OCI) GetVersions(ctx context.Context) ([]SourceImage, error) {
106104
out <- Result[SourceImage]{err: errors.New("architecture annotation not found in descriptor")}
107105
return
108106
}
109-
created := time.Time{}
110-
if s, ok := manifest.Annotations["org.opencontainers.image.created"]; ok {
111-
if t, err := time.Parse(time.RFC3339, s); err == nil {
112-
created = t
113-
}
114-
} else if s, ok := manifest.Annotations["created"]; ok {
115-
if t, err := time.Parse(time.RFC3339, s); err == nil {
116-
created = t
117-
}
118-
}
119107
out <- Result[SourceImage]{
120108
value: SourceImage{
121109
Version: strings.ReplaceAll(tag, "_", "+"), // Follow the helm convention
122110
Architectures: []string{arch},
123-
CreatedAt: created,
124111
},
125112
}
126113
}()

0 commit comments

Comments
 (0)