Skip to content

Commit

Permalink
Merge pull request #966 from syself/batistein/bump-caph-builder-image…
Browse files Browse the repository at this point in the history
…-1.0.9

🌱 update caph builder image to 1.0.9
  • Loading branch information
batistein authored Sep 27, 2023
2 parents 5ae8d9c + 38f759e commit d5cfd08
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .builder-image-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.8
1.0.9
2 changes: 1 addition & 1 deletion .github/workflows/main-promote-builder-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Promote Latest tag to Caph Builder Image
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.8
image: ghcr.io/syself/caph-builder:1.0.9
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event_name != 'pull_request_target' || !github.event.pull_request.draft
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.8
image: ghcr.io/syself/caph-builder:1.0.9
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-scan-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Trivy
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.8
image: ghcr.io/syself/caph-builder:1.0.9
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
8 changes: 4 additions & 4 deletions controllers/hcloudmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/patch"
Expand Down Expand Up @@ -98,7 +98,7 @@ var _ = Describe("HCloudMachineReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down Expand Up @@ -207,7 +207,7 @@ var _ = Describe("HCloudMachineReconciler", func() {
Expect(err).ShouldNot(HaveOccurred())

capiMachine.Spec.Bootstrap = clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
}

Eventually(func() error {
Expand Down Expand Up @@ -463,7 +463,7 @@ var _ = Describe("Hetzner secret", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down
8 changes: 4 additions & 4 deletions controllers/hetznerbaremetalhost_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util/patch"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -264,7 +264,7 @@ var _ = Describe("HetznerBareMetalHostReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down Expand Up @@ -461,7 +461,7 @@ var _ = Describe("HetznerBareMetalHostReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down Expand Up @@ -609,7 +609,7 @@ var _ = Describe("HetznerBareMetalHostReconciler - missing secrets", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down
10 changes: 5 additions & 5 deletions controllers/hetznerbaremetalmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util/patch"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -258,7 +258,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
Expect(err).ShouldNot(HaveOccurred())

capiMachine.Spec.Bootstrap = clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
}
Eventually(func() error {
return ph.Patch(ctx, capiMachine, patch.WithStatusObservedGeneration{})
Expand Down Expand Up @@ -292,7 +292,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down Expand Up @@ -457,7 +457,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down Expand Up @@ -515,7 +515,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/hetznercluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/cluster-api/util/patch"
Expand Down Expand Up @@ -614,7 +614,7 @@ func createCapiAndHcloudMachines(ctx context.Context, env *helpers.TestEnvironme
},
FailureDomain: &defaultFailureDomain,
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("bootstrap-secret"),
DataSecretName: ptr.To("bootstrap-secret"),
},
},
}
Expand Down
14 changes: 7 additions & 7 deletions images/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# If you make changes to this Dockerfile run `make builder-image-push`.

# Install Lychee
FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as lychee
FROM docker.io/library/alpine:3.18.3@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 as lychee
# update: datasource=github-tags depName=lycheeverse/lychee versioning=semver
ENV LYCHEE_VERSION="v0.11.1"
ENV LYCHEE_VERSION="v0.13.0"
# hadolint ignore=DL3018
RUN apk add --no-cache curl && \
curl -L -o /tmp/lychee-${LYCHEE_VERSION}.tgz https://github.com/lycheeverse/lychee/releases/download/${LYCHEE_VERSION}/lychee-${LYCHEE_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \
Expand All @@ -28,9 +28,9 @@ RUN apk add --no-cache curl && \
rm -rf /tmp/linux-amd64 /tmp/lychee-${LYCHEE_VERSION}.tgz

# Install Golang CI Lint
FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as golangci
FROM docker.io/library/alpine:3.18.3@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 as golangci
# update: datasource=github-tags depName=golangci/golangci-lint versioning=semver
ENV GOLANGCI_VERSION="v1.52.2"
ENV GOLANGCI_VERSION="v1.54.2"
WORKDIR /
# hadolint ignore=DL3018,DL4006
RUN apk add --no-cache curl && \
Expand All @@ -40,17 +40,17 @@ RUN apk add --no-cache curl && \
FROM docker.io/hadolint/hadolint:v2.12.0-alpine@sha256:7dba9a9f1a0350f6d021fb2f6f88900998a4fb0aaf8e4330aa8c38544f04db42 as hadolint

# Install Trivy
FROM docker.io/aquasec/trivy:0.39.0@sha256:ab281f43ee11b8ea5443ca8897641441f04f14e8832fefd103d32b4acd7055e1 as trivy
FROM docker.io/aquasec/trivy:0.45.1@sha256:88ee0d68a0265099d36895b9fef4de0415f7a7b6ea6cc23038e23eba93780960 as trivy

############################
# Caph Build Image Base #
############################
FROM docker.io/library/golang:1.21.1-bullseye@sha256:357be9f9e594a338ba16f54c4df16481e7e82533a6571cecaf22dca833622f91
FROM docker.io/library/golang:1.21.1-bullseye@sha256:4f23be7ef78eedf4ec41661a92ef73f53f722f57194adddf7d9b40699753c776

# update: datasource=repology depName=debian_11/skopeo versioning=loose
ENV SKOPEO_VERSION="1.2.2+dfsg1-1+b6"
# update: datasource=github-tags depName=adrienverge/yamllint versioning=semver
ENV YAMLLINT_VERSION="v1.30.0"
ENV YAMLLINT_VERSION="v1.32.0"
# update: datasource=github-tags depName=opt-nc/yamlfixer versioning=semver
ENV YAMLFIXER_VERSION="0.9.15"

Expand Down
6 changes: 3 additions & 3 deletions pkg/services/baremetal/baremetal/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
capierrors "sigs.k8s.io/cluster-api/errors"
"sigs.k8s.io/cluster-api/util/conditions"
Expand Down Expand Up @@ -635,13 +635,13 @@ func setOwnerRefInList(refList []metav1.OwnerReference, objType metav1.TypeMeta,
Kind: objType.Kind,
Name: objMeta.Name,
UID: objMeta.UID,
Controller: pointer.Bool(isController),
Controller: ptr.To(isController),
})
} else {
// update existing owner ref because the UID and the APIVersion might change due to move or version upgrade
refList[index].APIVersion = objType.APIVersion
refList[index].UID = objMeta.UID
refList[index].Controller = pointer.Bool(isController)
refList[index].Controller = ptr.To(isController)
}
return refList
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/services/baremetal/baremetal/baremetal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/selection"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
Expand Down Expand Up @@ -454,7 +454,7 @@ var _ = Describe("Test setOwnerRefInList", func() {
Name: "bm-machine",
Kind: "HetznerBareMetalMachine",
APIVersion: "v1beta1",
Controller: pointer.Bool(true),
Controller: ptr.To(true),
},
},
}),
Expand All @@ -471,7 +471,7 @@ var _ = Describe("Test setOwnerRefInList", func() {
Name: "bm-machine",
Kind: "HetznerBareMetalMachine",
APIVersion: "v1beta1",
Controller: pointer.Bool(true),
Controller: ptr.To(true),
},
},
}),
Expand Down Expand Up @@ -503,7 +503,7 @@ var _ = Describe("Test setOwnerRefInList", func() {
Name: "bm-machine",
Kind: "HetznerBareMetalMachine",
APIVersion: "v1beta1",
Controller: pointer.Bool(true),
Controller: ptr.To(true),
},
},
}),
Expand Down
16 changes: 8 additions & 8 deletions pkg/services/baremetal/host/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/mock"
"github.com/syself/hrobot-go/models"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

infrav1 "github.com/syself/cluster-api-provider-hetzner/api/v1beta1"
bmmock "github.com/syself/cluster-api-provider-hetzner/pkg/services/baremetal/client/mocks"
Expand Down Expand Up @@ -183,7 +183,7 @@ NAME="nvme1n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVLB512HAJQ-00000" VENDOR=""
NAME="nvme2n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVL22T0HBLB-00B00" VENDOR="" SERIAL="S677NF0R402742" SIZE="2048408248320" WWN="eui.002538b411b2cee8" ROTA="0"
NAME="nvme1n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVLB512HAJQ-00000" VENDOR="" SERIAL="S3W8NX0N811178" SIZE="512110190592" WWN="eui.0025388801b4dff2" ROTA="0"`,
expectedOutput: nil,
expectedErrorMessage: pointer.String("unknown rota"),
expectedErrorMessage: ptr.To("unknown rota"),
}),
)
})
Expand Down Expand Up @@ -986,7 +986,7 @@ var _ = Describe("analyzeSSHOutputProvisioned", func() {
out: sshclient.Output{StdOut: "wrong_hostname"},
expectedIsTimeout: false,
expectedIsConnectionRefused: false,
expectedErrMessage: pointer.String("unexpected hostname"),
expectedErrMessage: ptr.To("unexpected hostname"),
}),
Entry("timeout error", testCaseAnalyzeSSHOutputProvisioned{
out: sshclient.Output{Err: timeout},
Expand All @@ -998,19 +998,19 @@ var _ = Describe("analyzeSSHOutputProvisioned", func() {
out: sshclient.Output{StdErr: "some error"},
expectedIsTimeout: false,
expectedIsConnectionRefused: false,
expectedErrMessage: pointer.String("failed to get hostname via ssh: StdErr: some error"),
expectedErrMessage: ptr.To("failed to get hostname via ssh: StdErr: some error"),
}),
Entry("incorrect boot - empty hostname", testCaseAnalyzeSSHOutputProvisioned{
out: sshclient.Output{StdOut: ""},
expectedIsTimeout: false,
expectedIsConnectionRefused: false,
expectedErrMessage: pointer.String("hostname is empty"),
expectedErrMessage: ptr.To("hostname is empty"),
}),
Entry("unable to authenticate", testCaseAnalyzeSSHOutputProvisioned{
out: sshclient.Output{Err: sshclient.ErrAuthenticationFailed},
expectedIsTimeout: false,
expectedIsConnectionRefused: false,
expectedErrMessage: pointer.String("wrong ssh key"),
expectedErrMessage: ptr.To("wrong ssh key"),
}),
Entry("connection refused", testCaseAnalyzeSSHOutputProvisioned{
out: sshclient.Output{Err: sshclient.ErrConnectionRefused},
Expand Down Expand Up @@ -1108,7 +1108,7 @@ var _ = Describe("actionRegistering", func() {
includeRootDeviceHintWWN: true,
includeRootDeviceHintRaid: false,
expectedActionResult: actionFailed{},
expectedErrorMessage: pointer.String("missing storage device for root device hint eui.002538b411b2cee8"),
expectedErrorMessage: ptr.To("missing storage device for root device hint eui.002538b411b2cee8"),
}),
Entry("no root device hints", testCaseActionRegistering{
storageStdOut: `NAME="loop0" LABEL="" FSTYPE="ext2" TYPE="loop" HCTL="" MODEL="" VENDOR="" SERIAL="" SIZE="3068773888" WWN="" ROTA="0"
Expand All @@ -1117,7 +1117,7 @@ var _ = Describe("actionRegistering", func() {
includeRootDeviceHintWWN: false,
includeRootDeviceHintRaid: false,
expectedActionResult: actionFailed{},
expectedErrorMessage: pointer.String(infrav1.ErrorMessageMissingRootDeviceHints),
expectedErrorMessage: ptr.To(infrav1.ErrorMessageMissingRootDeviceHints),
}),
)

Expand Down
3 changes: 2 additions & 1 deletion pkg/services/hcloud/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (

"github.com/hetznercloud/hcloud-go/v2/hcloud"
"github.com/prometheus/client_golang/prometheus"
caphversion "github.com/syself/cluster-api-provider-hetzner/pkg/version"
"sigs.k8s.io/controller-runtime/pkg/metrics"

caphversion "github.com/syself/cluster-api-provider-hetzner/pkg/version"
)

const errStringUnauthorized = "(unauthorized)"
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/hcloud/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
"sigs.k8s.io/cluster-api/util/conditions"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
Expand Down Expand Up @@ -281,7 +281,7 @@ var _ = Describe("handleServerStatusOff", func() {
Expect(res).Should(Equal(emptyResult))

Expect(server.Status).To(Equal(hcloud.ServerStatusOff))
Expect(hcloudMachine.Status.FailureMessage).Should(Equal(pointer.String("reached timeout of waiting for machines that are switched off")))
Expect(hcloudMachine.Status.FailureMessage).Should(Equal(ptr.To("reached timeout of waiting for machines that are switched off")))
})

It("tries to power on server and sets new condition if different one is set", func() {
Expand Down
Loading

0 comments on commit d5cfd08

Please sign in to comment.