Skip to content

Commit f5c1ec0

Browse files
authored
Merge branch 'main' into oci_fallback
2 parents a5983ee + 4975d5e commit f5c1ec0

File tree

17 files changed

+47
-28
lines changed

17 files changed

+47
-28
lines changed

.github/workflows/build-test.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
permissions:
1414
contents: read # for actions/checkout to fetch code
1515
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
16+
checks: write # for golangci/golangci-lint-action to annotate Pull Requests
1617
name: Lint Go code
1718
runs-on: ubuntu-latest
1819
steps:
@@ -21,9 +22,9 @@ jobs:
2122
- name: Setup Golang
2223
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.0
2324
- name: Run golangci-lint
24-
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
25+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
2526
with:
26-
version: v1.53
27+
version: v1.54
2728
args: --timeout 10m --exclude SA5011 --verbose --issues-exit-code=0
2829
only-new-issues: true
2930

@@ -83,7 +84,18 @@ jobs:
8384
with:
8485
context: .
8586
platforms: ${{ matrix.platform }}
87+
load: true
8688
push: false
8789
tags: quay.io/jetstack/version-checker:${{github.sha}}
8890
cache-from: type=gha
8991
cache-to: type=gha,mode=max
92+
93+
- name: Run Trivy vulnerability scanner
94+
uses: aquasecurity/trivy-action@0.19.0
95+
with:
96+
image-ref: 'quay.io/jetstack/version-checker:${{github.sha}}'
97+
format: 'table'
98+
exit-code: '1'
99+
ignore-unfixed: true
100+
vuln-type: 'os,library'
101+
severity: 'CRITICAL,HIGH'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WORKDIR /app/
88
RUN make build
99

1010

11-
FROM alpine:3.18.3
11+
FROM alpine:3.19.1
1212
LABEL description="Kubernetes utility for exposing used image versions compared to the latest version, as metrics."
1313

1414
RUN apk --no-cache add ca-certificates

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ verify: test build ## tests and builds version-checker
2222

2323
image: ## build docker image
2424
GOARCH=$(ARCH) GOOS=linux CGO_ENABLED=0 go build -o ./bin/version-checker-linux ./cmd/.
25-
docker build -t quay.io/jetstack/version-checker:v0.5.2 .
25+
docker build -t quay.io/jetstack/version-checker:v0.5.4 .
2626

2727
clean: ## clean up created files
2828
rm -rf \

deploy/charts/version-checker/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
2-
appVersion: "v0.5.2"
3-
version: "v0.5.2"
2+
appVersion: "v0.5.4"
3+
version: "v0.5.4"
44
description: A Helm chart for version-checker
55
home: https://github.com/jetstack/version-checker
66
name: version-checker

deploy/charts/version-checker/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ A Helm chart for version-checker
3737
| image.tag | string | `nil` | Override the chart version |
3838
| livenessProbe | object | `{"enabled":true,"httpGet":{"path":"/readyz","port":8080},"initialDelaySeconds":3,"periodSeconds":3}` | Configure the healthcheck probe for version-checker |
3939
| livenessProbe.enabled | bool | `true` | Enable/Disable the setting of a livenessProbe |
40+
| nodeSelector | object | `{}` | Configure nodeSelector |
4041
| prometheus | object | `{"enabled":false,"replicas":1,"serviceAccountName":"prometheus"}` | Prometheus Operator |
4142
| prometheus.enabled | bool | `false` | Deploy a Prometheus-Operator Prometheus Object to collect version-checker metrics |
4243
| prometheus.serviceAccountName | string | `"prometheus"` | ServiceAccount for new Prometheus Object |
@@ -58,4 +59,4 @@ A Helm chart for version-checker
5859
| versionChecker.testAllContainers | bool | `true` | Enable/Disable the requirement for an enable.version-checker.io annotation on pods. |
5960

6061
----------------------------------------------
61-
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
62+
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)

deploy/charts/version-checker/templates/deployment.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ spec:
3232
spec:
3333
serviceAccountName: {{ $chartname }}
3434
{{- with .Values.tolerations }}
35-
tolerations:
35+
tolerations:
3636
{{- toYaml . | trim | nindent 8 }}
3737
{{- end }}
38+
{{- with .Values.nodeSelector }}
39+
nodeSelector:
40+
{{- toYaml . | nindent 8 }}
41+
{{- end }}
3842
containers:
3943
- name: {{ $chartname }}
4044
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

deploy/charts/version-checker/tests/deployment_test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ tests:
5959
name: CUSTOM_ENV_VAR
6060
value: CUSTOM_ENV_VALUE
6161

62+
- it: NodeSelectors Present
63+
set:
64+
nodeSelector:
65+
abc: "123"
66+
asserts:
67+
- equal:
68+
path: spec.template.spec.nodeSelector.abc
69+
value: "123"
70+
6271
# Param changes
6372
- it: imageCacheTimeout
6473
set:

deploy/charts/version-checker/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ image:
2020
# -- Configure tolerations
2121
tolerations: []
2222

23+
# -- Configure nodeSelector
24+
nodeSelector: {}
25+
2326
# -- Configure version-checkers Service
2427
service:
2528
labels: {}

deploy/yaml/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ spec:
4949
spec:
5050
serviceAccountName: version-checker
5151
containers:
52-
- image: quay.io/jetstack/version-checker:v0.5.2
52+
- image: quay.io/jetstack/version-checker:v0.5.4
5353
imagePullPolicy: Always
5454
ports:
5555
- containerPort: 8080

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ require (
9696
golang.org/x/text v0.14.0 // indirect
9797
golang.org/x/time v0.3.0 // indirect
9898
google.golang.org/appengine v1.6.8 // indirect
99-
google.golang.org/protobuf v1.31.0 // indirect
99+
google.golang.org/protobuf v1.33.0 // indirect
100100
gopkg.in/evanphx/json-patch.v5 v5.7.0 // indirect
101101
gopkg.in/inf.v0 v0.9.1 // indirect
102102
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs
260260
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
261261
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
262262
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
263-
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
264-
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
263+
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
264+
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
265265
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
266266
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
267267
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

pkg/client/acr/acr.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ type ACRManifestResponse struct {
5555

5656
func New(opts Options) (*Client, error) {
5757
client := &http.Client{
58-
Timeout: time.Second * 5,
59-
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
58+
Timeout: time.Second * 5,
6059
}
6160

6261
if len(opts.RefreshToken) > 0 &&

pkg/client/docker/docker.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ type Image struct {
5252

5353
func New(ctx context.Context, opts Options) (*Client, error) {
5454
client := &http.Client{
55-
Timeout: time.Second * 10,
56-
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
55+
Timeout: time.Second * 10,
5756
}
5857

5958
// Setup Auth if username and password used.

pkg/client/ecr/ecr.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package ecr
33
import (
44
"context"
55
"fmt"
6-
"net/http"
76
"sync"
87

98
"github.com/aws/aws-sdk-go/aws"
@@ -103,8 +102,6 @@ func (c *Client) getClient(region string) (*ecr.ECR, error) {
103102
return nil, err
104103
}
105104
}
106-
// Try and use an HTTP(S) Proxies defined within Environment variables.
107-
client.Config.WithHTTPClient(&http.Client{Transport: &http.Transport{Proxy: http.ProxyFromEnvironment}})
108105

109106
c.cachedRegionClients[region] = client
110107
return client, nil

pkg/client/gcr/gcr.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ type ManifestItem struct {
3535
}
3636

3737
func New(opts Options) *Client {
38-
client := &http.Client{
39-
Timeout: time.Second * 5,
40-
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
41-
}
42-
4338
return &Client{
4439
Options: opts,
45-
Client: client,
40+
Client: &http.Client{
41+
Timeout: time.Second * 5,
42+
},
4643
}
4744
}
4845

pkg/client/ghcr/ghcr.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ func New(opts Options) *Client {
2525
return &Client{
2626
Options: opts,
2727
Client: &http.Client{
28-
Timeout: time.Second * 5,
29-
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
28+
Timeout: time.Second * 5,
3029
},
3130
}
3231
}

pkg/client/quay/quay.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ type responseManifestDataItem struct {
5959

6060
func New(opts Options) *Client {
6161
client := retryablehttp.NewClient()
62-
client.HTTPClient.Transport = &http.Transport{Proxy: http.ProxyFromEnvironment}
6362
client.RetryMax = 10
6463
client.Logger = nil
6564

0 commit comments

Comments
 (0)