Skip to content

Commit a94c922

Browse files
feat: inject deps from finch-core (#1679)
inject deps from finch-core Signed-off-by: Swapnanil-Gupta <swpnlg@amazon.com>
1 parent c03b460 commit a94c922

File tree

8 files changed

+82
-96
lines changed

8 files changed

+82
-96
lines changed

Makefile

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ COVERAGE_DIR ?= $(CURDIR)/cov
1212
REPORT_DIR ?= $(CURDIR)/reports
1313
RUN_ID ?= $(GITHUB_RUN_ID)
1414
RUN_ATTEMPT ?= $(GITHUB_RUN_ATTEMPT)
15+
FINCH_CORE_DIR := $(CURDIR)/deps/finch-core
1516

1617
OUTPUT_DIRECTORIES := $(OUTDIR) $(OS_OUTDIR)
1718
$(OUTPUT_DIRECTORIES):
@@ -34,9 +35,21 @@ GITCOMMIT ?= $(shell git rev-parse HEAD)$(shell test -z "$(git status --porcelai
3435
VERSION_INJECTION := -X $(PACKAGE)/pkg/version.Version=$(VERSION)
3536
VERSION_INJECTION += -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)
3637
VERSION_INJECTION += -X $(PACKAGE)/pkg/version.GitCommit=$(GITCOMMIT)
37-
LDFLAGS = "-w $(VERSION_INJECTION)"
3838
MIN_MACOS_VERSION ?= 11.0
3939

40+
# Inject soci version
41+
-include $(FINCH_CORE_DIR)/deps/soci.conf
42+
VERSION_INJECTION += -X $(PACKAGE)/pkg/config.SociVersion=$(SOCI_VERSION)
43+
VERSION_INJECTION += -X $(PACKAGE)/pkg/config.SociAMD64Sha256Sum=$(SOCI_AMD64_SHA256_DIGEST)
44+
VERSION_INJECTION += -X $(PACKAGE)/pkg/config.SociARM64Sha256Sum=$(SOCI_ARM64_SHA256_DIGEST)
45+
46+
# Inject ecr-cred-helper version
47+
-include $(FINCH_CORE_DIR)/deps/ecr-cred-helper.conf
48+
VERSION_INJECTION += -X $(PACKAGE)/pkg/dependency/credhelper.EcrVersion=$(ECR_CRED_HELPER_VERSION)
49+
VERSION_INJECTION += -X $(PACKAGE)/pkg/dependency/credhelper.EcrAMD64Hash=$(ECR_CRED_HELPER_AMD64_DIGEST)
50+
VERSION_INJECTION += -X $(PACKAGE)/pkg/dependency/credhelper.EcrARM64Hash=$(ECR_CRED_HELPER_ARM64_DIGEST)
51+
LDFLAGS = "-w $(VERSION_INJECTION)"
52+
4053
FINCH_DAEMON_LOCATION_ROOT ?= $(FINCH_OS_IMAGE_LOCATION_ROOT)/finch-daemon
4154
FINCH_DAEMON_LOCATION ?= $(FINCH_DAEMON_LOCATION_ROOT)/finch-daemon
4255
FINCH_DAEMON_CREDHELPER_LOCATION ?= $(FINCH_DAEMON_LOCATION_ROOT)/docker-credential-finch
@@ -81,9 +94,7 @@ ifeq ($(BUILD_OS),)
8194
BUILD_OS = $(shell uname -s)
8295
endif
8396

84-
FINCH_CORE_DIR := $(CURDIR)/deps/finch-core
85-
86-
remote-all: arch-test install.finch-core-dependencies finch finch.yaml networks.yaml config.yaml $(OUTDIR)/finch-daemon/finch@.service
97+
remote-all: arch-test finch install.finch-core-dependencies finch.yaml networks.yaml config.yaml $(OUTDIR)/finch-daemon/finch@.service
8798

8899
ifeq ($(BUILD_OS), Windows_NT)
89100
include Makefile.windows
@@ -108,13 +119,13 @@ CONTAINER_RUNTIME_ARCHIVE_AARCH64_DIGEST ?= "sha256:$(AARCH64_256_DIGEST)"
108119
CONTAINER_RUNTIME_ARCHIVE_X86_64_LOCATION ?= "$(ARTIFACT_BASE_URL)/$(X86_64_ARTIFACT)"
109120
CONTAINER_RUNTIME_ARCHIVE_X86_64_DIGEST ?= "sha256:$(X86_64_256_DIGEST)"
110121

111-
# For Finch on macOS and Windows, the runc override locations and digests are set
112-
# based on the values set in deps/finch-core/deps/runc-override.conf
113-
-include $(FINCH_CORE_DIR)/deps/runc-override.conf
114-
RUNC_OVERRIDE_AARCH64_LOCATION ?= "$(RUNC_ARTIFACT_BASE_URL)/$(RUNC_AARCH64_ARTIFACT)"
115-
RUNC_OVERRIDE_AARCH64_DIGEST ?= "sha256:$(RUNC_AARCH64_256_DIGEST)"
116-
RUNC_OVERRIDE_X86_64_LOCATION ?= "$(RUNC_ARTIFACT_BASE_URL)/$(RUNC_X86_64_ARTIFACT)"
117-
RUNC_OVERRIDE_X86_64_DIGEST ?= "sha256:$(RUNC_X86_64_256_DIGEST)"
122+
# Inject dependency versions for E2E VM serial tests
123+
E2E_VM_VERSION_INJECTION := $(VERSION_INJECTION)
124+
E2E_VM_VERSION_INJECTION += -X $(PACKAGE)/e2e/vm.NerdctlVersion=v$(NERDCTL_VERSION)
125+
E2E_VM_VERSION_INJECTION += -X $(PACKAGE)/e2e/vm.ContainerdVersion=v$(CONTAINERD_VERSION)
126+
E2E_VM_VERSION_INJECTION += -X $(PACKAGE)/e2e/vm.BuildKitVersion=v$(BUILDKIT_VERSION)
127+
E2E_VM_VERSION_INJECTION += -X $(PACKAGE)/e2e/vm.RuncVersion=$(RUNC_VERSION)
128+
E2E_VM_LDFLAGS := -w $(E2E_VM_VERSION_INJECTION)
118129

119130
.PHONY: finch.yaml
120131
finch.yaml: $(OS_OUTDIR)/finch.yaml
@@ -349,15 +360,15 @@ test-e2e: test-e2e-vm-serial test-e2e-container
349360

350361
.PHONY: test-e2e-vm-serial
351362
test-e2e-vm-serial: create-report-dir create-coverage-dir add-credhelper-to-path
352-
FINCH_GOCOVERDIR=$(COVERAGE_DIR) go test -coverpkg=./... -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -test.gocoverdir=$(COVERAGE_DIR) -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-serial-report.json --installed="$(INSTALLED)"
363+
FINCH_GOCOVERDIR=$(COVERAGE_DIR) go test -coverpkg=./... -ldflags "$(E2E_VM_LDFLAGS)" -timeout 2h ./e2e/vm -test.v -test.gocoverdir=$(COVERAGE_DIR) -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-serial-report.json --installed="$(INSTALLED)"
353364

354365
.PHONY: test-e2e-container
355366
test-e2e-container: create-report-dir create-coverage-dir add-credhelper-to-path
356367
FINCH_GOCOVERDIR=$(COVERAGE_DIR) go test -coverpkg=./... -ldflags $(LDFLAGS) -timeout 2h ./e2e/container -test.v -test.gocoverdir=$(COVERAGE_DIR) -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-container-report.json --installed="$(INSTALLED)"
357368

358369
.PHONY: test-e2e-vm
359370
test-e2e-vm: create-report-dir create-coverage-dir
360-
FINCH_GOCOVERDIR=$(COVERAGE_DIR) go test -coverpkg=./... -ldflags $(LDFLAGS) -timeout 2h ./e2e/vm -test.v -test.gocoverdir=$(COVERAGE_DIR) -ginkgo.v -ginkgo.timeout=2h -ginkgo.focus "updates init-only config values when values are changed after init" -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-report.json --installed="$(INSTALLED)" --registry="$(REGISTRY)"
371+
FINCH_GOCOVERDIR=$(COVERAGE_DIR) go test -coverpkg=./... -ldflags "$(E2E_VM_LDFLAGS)" -timeout 2h ./e2e/vm -test.v -test.gocoverdir=$(COVERAGE_DIR) -ginkgo.v -ginkgo.timeout=2h -ginkgo.flake-attempts=3 -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-vm-report.json --installed="$(INSTALLED)" --registry="$(REGISTRY)"
361372

362373
.PHONY: test-e2e-cov
363374
test-e2e-cov:
@@ -386,7 +397,9 @@ test-e2e-daemon:
386397
DOCKER_HOST=$(DAEMON_DOCKER_HOST) \
387398
DOCKER_API_VERSION="v1.41" \
388399
TEST_E2E=1 \
389-
go test ./e2e -timeout 15m -test.v -ginkgo.v -ginkgo.randomize-all -ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-daemon-report.json \
400+
go test ./e2e -timeout 30m -test.v -ginkgo.v \
401+
-ginkgo.randomize-all -ginkgo.flake-attempts=3 \
402+
-ginkgo.json-report=$(REPORT_DIR)/$(RUN_ID)-$(RUN_ATTEMPT)-e2e-daemon-report.json \
390403
--subject="$(OUTDIR)/bin/$(BINARYNAME)" \
391404
--daemon-context-subject-prefix="$(OUTDIR)/lima/bin/limactl shell finch sudo" \
392405
--daemon-context-subject-env="LIMA_HOME=$(OUTDIR)/lima/data"

Makefile.windows

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ $(OS_OUTDIR)/finch.yaml: $(OS_OUTDIR) finch.yaml.d/common.yaml finch.yaml.d/wind
3232
sed -i.bak -e "s/<container_runtime_archive_aarch64_digest>/$(CONTAINER_RUNTIME_ARCHIVE_AARCH64_DIGEST)/g" finch.yaml.temp
3333
sed -i.bak -e "s|<container_runtime_archive_x86_64_location>|$(CONTAINER_RUNTIME_ARCHIVE_X86_64_LOCATION)|g" finch.yaml.temp
3434
sed -i.bak -e "s/<container_runtime_archive_x86_64_digest>/$(CONTAINER_RUNTIME_ARCHIVE_X86_64_DIGEST)/g" finch.yaml.temp
35-
sed -i.bak -e "s|<runc_override_aarch64_location>|$(RUNC_OVERRIDE_AARCH64_LOCATION)|g" finch.yaml.temp
36-
sed -i.bak -e "s/<runc_override_aarch64_digest>/$(RUNC_OVERRIDE_AARCH64_DIGEST)/g" finch.yaml.temp
37-
sed -i.bak -e "s|<runc_override_x86_64_location>|$(RUNC_OVERRIDE_X86_64_LOCATION)|g" finch.yaml.temp
38-
sed -i.bak -e "s/<runc_override_x86_64_digest>/$(RUNC_OVERRIDE_X86_64_DIGEST)/g" finch.yaml.temp
3935

4036
# Replacement was successful, so cleanup .bak
4137
@rm finch.yaml.temp.bak

e2e/vm/version_remote_test.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ import (
1818
"github.com/runfinch/finch/pkg/version"
1919
)
2020

21-
// TODO: read this from finch-core/deps.
22-
const (
23-
nerdctlVersion = "v2.2.1"
24-
buildKitVersion = "v0.26.3"
25-
containerdVersion = "v2.2.1"
26-
runcVersion = "1.3.3"
21+
var (
22+
// NerdctlVersion is filled via Makefile.
23+
NerdctlVersion string
24+
// ContainerdVersion is filled via Makefile.
25+
ContainerdVersion string
26+
// BuildKitVersion is filled via Makefile.
27+
BuildKitVersion string
28+
// RuncVersion is filled via Makefile.
29+
RuncVersion string
2730
)
2831

2932
type Versions struct {
@@ -38,10 +41,10 @@ type Versions struct {
3841
var versions = Versions{
3942
FinchVersion: strings.ReplaceAll(version.Version, ".", "\\."),
4043
FinchCommit: strings.ReplaceAll(version.GitCommit, ".", "\\."),
41-
NerdctlVersion: strings.ReplaceAll(nerdctlVersion, ".", "\\."),
42-
BuildKitVersion: strings.ReplaceAll(buildKitVersion, ".", "\\."),
43-
ContainerdVersion: strings.ReplaceAll(containerdVersion, ".", "\\."),
44-
RuncVersion: strings.ReplaceAll(runcVersion, ".", "\\."),
44+
NerdctlVersion: strings.ReplaceAll(NerdctlVersion, ".", "\\."),
45+
BuildKitVersion: strings.ReplaceAll(BuildKitVersion, ".", "\\."),
46+
ContainerdVersion: strings.ReplaceAll(ContainerdVersion, ".", "\\."),
47+
RuncVersion: strings.ReplaceAll(RuncVersion, ".", "\\."),
4548
}
4649

4750
// Checks finch version.

finch.yaml.d/common.yaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,6 @@ provision:
2929
- mode: user
3030
script: |
3131
#!/bin/bash
32-
33-
# Override runc with specified version after container runtime is installed
34-
ARCH=$(uname -m)
35-
if [ "$ARCH" = "x86_64" ]; then
36-
RUNC_URL="<runc_override_x86_64_location>"
37-
RUNC_DIGEST="<runc_override_x86_64_digest>"
38-
elif [ "$ARCH" = "aarch64" ]; then
39-
RUNC_URL="<runc_override_aarch64_location>"
40-
RUNC_DIGEST="<runc_override_aarch64_digest>"
41-
else
42-
echo "Unsupported architecture: $ARCH"
43-
exit 1
44-
fi
45-
46-
# Download and verify runc override
47-
curl -L --fail "$RUNC_URL" -o /tmp/runc-override
48-
echo "$RUNC_DIGEST /tmp/runc-override" | sha256sum -c -
49-
50-
# Replace the existing runc binary
51-
sudo chmod +x /tmp/runc-override
52-
sudo cp /tmp/runc-override /usr/local/bin/runc
53-
sudo cp /tmp/runc-override /usr/bin/runc
54-
sudo rm /tmp/runc-override
55-
56-
# Verify runc version is >= 1.3.3
57-
INSTALLED_VERSION=$(runc --version | head -n1 | awk '{print $3}')
58-
REQUIRED_VERSION="1.3.3"
59-
if ! printf '%s\n%s\n' "$REQUIRED_VERSION" "$INSTALLED_VERSION" | sort -V -C; then
60-
echo "ERROR: runc version $INSTALLED_VERSION is less than required $REQUIRED_VERSION"
61-
exit 1
62-
fi
63-
echo "SUCCESS: runc version $INSTALLED_VERSION meets requirement >= $REQUIRED_VERSION"
64-
65-
# Restart containerd
66-
sudo systemctl restart containerd.service
67-
- mode: user
68-
script: |
69-
#!/bin/bash
7032
7133
# Enable SSHing into the VM as root (e.g., in `nerdctlConfigApplier.Apply`).
7234
sudo cp ~/.ssh/authorized_keys /root/.ssh/

pkg/config/lima_config_applier.go

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ import (
1919
"github.com/runfinch/finch/pkg/system"
2020
)
2121

22+
var (
23+
// SociVersion will be injected via Makefile.
24+
SociVersion string
25+
// SociAMD64Sha256Sum will be injected via Makefile.
26+
SociAMD64Sha256Sum string
27+
// SociARM64Sha256Sum will be injected via Makefile.
28+
SociARM64Sha256Sum string
29+
)
30+
2231
const (
23-
sociVersion = "0.11.1"
24-
sociAMD64Sha256Sum = "52d72692880150f974a48dbfa44bff01f1a3ba97815658cc16f835e5e7f96d49"
25-
sociARM64Sha256Sum = "da055b182000dbac3e916a8c731cbc0d7a204791311260c94d960a1160d25b3e"
2632
snapshotterProvisioningScriptHeader = "# snapshotter provisioning script"
2733
sociInstallationProvisioningScriptHeader = snapshotterProvisioningScriptHeader + ": soci"
2834
sociFileNameFormat = "soci-snapshotter-%s-linux-%s.tar.gz"
@@ -247,13 +253,13 @@ func (lca *limaConfigApplier) provisionSnapshotters(limaCfg *limayaml.LimaYAML)
247253

248254
func (lca *limaConfigApplier) provisionSociSnapshotter(limaCfg *limayaml.LimaYAML) {
249255
arch := lca.systemDeps.Arch()
250-
sociFileName := fmt.Sprintf(sociFileNameFormat, sociVersion, arch)
251-
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, sociVersion, sociFileName)
252-
sociSha256Sum := sociAMD64Sha256Sum
256+
sociFileName := fmt.Sprintf(sociFileNameFormat, SociVersion, arch)
257+
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, SociVersion, sociFileName)
258+
sociSha256Sum := SociAMD64Sha256Sum
253259
if arch == "arm64" {
254-
sociSha256Sum = sociARM64Sha256Sum
260+
sociSha256Sum = SociARM64Sha256Sum
255261
}
256-
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, sociVersion)
262+
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, SociVersion)
257263

258264
// Platform-specific DOCKER_CONFIG for SOCI service (macOS only)
259265
// This is needed as DOCKER_CONFIG for SOCI defaults to ~/.finch/config,

pkg/config/lima_config_applier_darwin_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ func TestDiskLimaConfigApplier_Apply(t *testing.T) {
110110
deps.EXPECT().Arch().Return(runtime.GOARCH)
111111
},
112112
postRunCheck: func(t *testing.T, fs afero.Fs) {
113-
sociFileName := fmt.Sprintf(sociFileNameFormat, sociVersion, runtime.GOARCH)
114-
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, sociVersion, sociFileName)
115-
sociShaSum := sociAMD64Sha256Sum
113+
sociFileName := fmt.Sprintf(sociFileNameFormat, SociVersion, runtime.GOARCH)
114+
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, SociVersion, sociFileName)
115+
sociShaSum := SociAMD64Sha256Sum
116116
if runtime.GOARCH == "arm64" {
117-
sociShaSum = sociARM64Sha256Sum
117+
sociShaSum = SociARM64Sha256Sum
118118
}
119-
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, sociVersion)
119+
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, SociVersion)
120120
dockerConfigSetup := ` sudo mkdir -p /etc/systemd/system/soci-snapshotter.service.d/
121121
printf '[Service]\nEnvironment="DOCKER_CONFIG=$HOME/.finch-vm-config"\n' | ` +
122122
`sudo tee /etc/systemd/system/soci-snapshotter.service.d/override.conf`
@@ -289,13 +289,13 @@ func TestDiskLimaConfigApplier_Apply(t *testing.T) {
289289
deps.EXPECT().Arch().Return(runtime.GOARCH)
290290
},
291291
postRunCheck: func(t *testing.T, fs afero.Fs) {
292-
sociFileName := fmt.Sprintf(sociFileNameFormat, sociVersion, runtime.GOARCH)
293-
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, sociVersion, sociFileName)
294-
sociShaSum := sociAMD64Sha256Sum
292+
sociFileName := fmt.Sprintf(sociFileNameFormat, SociVersion, runtime.GOARCH)
293+
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, SociVersion, sociFileName)
294+
sociShaSum := SociAMD64Sha256Sum
295295
if runtime.GOARCH == "arm64" {
296-
sociShaSum = sociARM64Sha256Sum
296+
sociShaSum = SociARM64Sha256Sum
297297
}
298-
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, sociVersion)
298+
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, SociVersion)
299299
dockerConfigSetup := ` sudo mkdir -p /etc/systemd/system/soci-snapshotter.service.d/
300300
printf '[Service]\nEnvironment="DOCKER_CONFIG=$HOME/.finch-vm-config"\n' | ` +
301301
`sudo tee /etc/systemd/system/soci-snapshotter.service.d/override.conf`
@@ -363,13 +363,13 @@ func TestDiskLimaConfigApplier_Apply(t *testing.T) {
363363
deps.EXPECT().Arch().Return(runtime.GOARCH)
364364
},
365365
postRunCheck: func(t *testing.T, fs afero.Fs) {
366-
sociFileName := fmt.Sprintf(sociFileNameFormat, sociVersion, runtime.GOARCH)
367-
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, sociVersion, sociFileName)
368-
sociShaSum := sociAMD64Sha256Sum
366+
sociFileName := fmt.Sprintf(sociFileNameFormat, SociVersion, runtime.GOARCH)
367+
sociDownloadURL := fmt.Sprintf(sociDownloadURLFormat, SociVersion, sociFileName)
368+
sociShaSum := SociAMD64Sha256Sum
369369
if runtime.GOARCH == "arm64" {
370-
sociShaSum = sociARM64Sha256Sum
370+
sociShaSum = SociARM64Sha256Sum
371371
}
372-
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, sociVersion)
372+
sociServiceDownloadURL := fmt.Sprintf(sociServiceDownloadURLFormat, SociVersion)
373373
dockerConfigSetup := ` sudo mkdir -p /etc/systemd/system/soci-snapshotter.service.d/
374374
printf '[Service]\nEnvironment="DOCKER_CONFIG=$HOME/.finch-vm-config"\n' | ` +
375375
`sudo tee /etc/systemd/system/soci-snapshotter.service.d/override.conf`

pkg/dependency/credhelper/cred_helper.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ import (
1717
"github.com/runfinch/finch/pkg/path"
1818
)
1919

20+
var (
21+
// EcrVersion will be injected via Makefile.
22+
EcrVersion string
23+
// EcrAMD64Hash will be injected via Makefile.
24+
EcrAMD64Hash string
25+
// EcrARM64Hash will be injected via Makefile.
26+
EcrARM64Hash string
27+
)
28+
2029
const (
2130
description = "Installing Credential Helper"
2231
errMsg = "Failed to finish installing credential helper"
@@ -66,11 +75,8 @@ func newDeps(
6675
configs := map[string]helperConfig{}
6776
installFolder := filepath.Join(finchDir, "cred-helpers")
6877

69-
const versionEcr = "0.9.0"
70-
const hashARM64 = "sha256:76aa3bb223d4e64dd4456376334273f27830c8d818efe278ab6ea81cb0844420"
71-
const hashAMD64 = "sha256:dd6bd933e439ddb33b9f005ad5575705a243d4e1e3d286b6c82928bcb70e949a"
7278
credHelperURLEcr := fmt.Sprintf("https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com"+
73-
"/%s/linux-%s/docker-credential-ecr-login", versionEcr, arch)
79+
"/%s/linux-%s/docker-credential-ecr-login", EcrVersion, arch)
7480

7581
hcEcr := helperConfig{
7682
binaryName: "docker-credential-ecr-login",
@@ -80,9 +86,9 @@ func newDeps(
8086
}
8187

8288
if arch == "arm64" {
83-
hcEcr.hash = hashARM64
89+
hcEcr.hash = EcrARM64Hash
8490
} else {
85-
hcEcr.hash = hashAMD64
91+
hcEcr.hash = EcrAMD64Hash
8692
}
8793

8894
configs["ecr-login"] = hcEcr

0 commit comments

Comments
 (0)