Skip to content

Commit a735563

Browse files
committed
- switch non-vendor downloader call sites back to the vendored logger interface
- add a local helm v4 downloader command outside vendor - restore repo builds with the current vendored utils state - improve logr adapter formatting and StartWait fallback - clean up helm test/build wiring and stale loft-util references Signed-off-by: Ryan Swanson <ryan.swanson@loft.sh>
1 parent 0630ad5 commit a735563

41 files changed

Lines changed: 802 additions & 972 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/unit-tests.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
strategy:
2222
matrix:
2323
os: [macos-latest, ubuntu-latest]
24-
24+
2525
name: unit-test-${{ matrix.os }}
2626
runs-on: ${{ matrix.os }}
27-
27+
2828
steps:
2929
- name: Set up Go
3030
uses: actions/setup-go@v5
@@ -34,10 +34,6 @@ jobs:
3434
- name: Check out code into the Go module directory
3535
uses: actions/checkout@v1
3636

37-
- name: Uninstall Helm 3.x
38-
run: |
39-
sudo rm -rf $(which helm) || true
40-
4137
- name: Test
4238
shell: bash
4339
run: |

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ require (
3131
github.com/json-iterator/go v1.1.12
3232
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
3333
github.com/loft-sh/go-github-selfupdate v1.0.0
34-
github.com/loft-sh/loft-util v0.0.9-alpha
3534
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee
3635
github.com/loft-sh/programming-language-detection v0.0.5
3736
github.com/loft-sh/utils v0.0.16

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn
343343
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
344344
github.com/loft-sh/go-github-selfupdate v1.0.0 h1:YS8iSsIWXw3BygBdPK2xDO4K84XYu2YuYgVS7eQNtik=
345345
github.com/loft-sh/go-github-selfupdate v1.0.0/go.mod h1:LDkR6J2QpqQLIMcYvNaSinVwvjPAkg8278oZBPGnrb8=
346-
github.com/loft-sh/loft-util v0.0.9-alpha h1:kGcyTQWxWHWy7bbjhS8Hsq/JRdlSztAU++anV6P+sqk=
347-
github.com/loft-sh/loft-util v0.0.9-alpha/go.mod h1:lsjG5Exh5iEf7Z/87nqwkxx3GRQTizFRLGuS1knF6Cg=
348346
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee h1:hZ79+pKEbCBrH1dVmgZ4jtFrrDPxgM4zqEP1lHlSnvI=
349347
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee/go.mod h1:pq83B8lgfCY7tKdegTTXU6DZxGQkcWMowUTOTpTQmqk=
350348
github.com/loft-sh/programming-language-detection v0.0.5 h1:XiWlxtrf4t6Z7SQiob0JMKaCeMHCP3kWhB80wLt+EMY=

hack/build-all.bash

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,25 @@ mkdir -p "${DEVSPACE_ROOT}/release"
4343

4444
# Install Helm 4
4545
echo "Installing helm"
46-
curl -s https://get.helm.sh/helm-v4.0.4-darwin-amd64.tar.gz > helm4.tar.gz && tar -zxvf helm4.tar.gz darwin-amd64/helm && chmod +x darwin-amd64/helm
46+
HELM_OS=$(uname -s | tr '[:upper:]' '[:lower:]')
47+
HELM_ARCH=$(uname -m)
48+
case "${HELM_ARCH}" in
49+
x86_64)
50+
HELM_ARCH="amd64"
51+
;;
52+
aarch64|arm64)
53+
HELM_ARCH="arm64"
54+
;;
55+
i386|i686)
56+
HELM_ARCH="386"
57+
;;
58+
esac
59+
HELM_PLATFORM="${HELM_OS}-${HELM_ARCH}"
60+
curl -s "https://get.helm.sh/helm-v4.0.4-${HELM_PLATFORM}.tar.gz" > helm4.tar.gz && tar -zxvf helm4.tar.gz "${HELM_PLATFORM}/helm" && chmod +x "${HELM_PLATFORM}/helm"
4761

4862
# Pull the component chart
4963
COMPONENT_CHART_VERSION=$(cat pkg/devspace/deploy/deployer/helm/client.go | grep 'Version: "' | sed -nE 's/[^"]+"(.+)",\s*/\1/p')
50-
darwin-amd64/helm pull component-chart --repo https://charts.devspace.sh --version $COMPONENT_CHART_VERSION
64+
"${HELM_PLATFORM}/helm" pull component-chart --repo https://charts.devspace.sh --version $COMPONENT_CHART_VERSION
5165

5266
# Move ui.tar.gz to releases
5367
echo "Moving ui"
@@ -74,28 +88,28 @@ for OS in ${DEVSPACE_BUILD_PLATFORMS[@]}; do
7488
if [[ "${OS}" == "windows" ]]; then
7589
NAME="${NAME}.exe"
7690
fi
77-
91+
7892
# darwin 386 is deprecated and shouldn't be used anymore
7993
if [[ "${ARCH}" == "386" && "${OS}" == "darwin" ]]; then
8094
echo "Building for ${OS}/${ARCH} not supported."
8195
continue
8296
fi
83-
97+
8498
# arm64 build is only supported for darwin
8599
if [[ "${ARCH}" == "arm64" && "${OS}" == "windows" ]]; then
86100
echo "Building for ${OS}/${ARCH} not supported."
87101
continue
88102
fi
89-
103+
90104
echo "Building for ${OS}/${ARCH}"
91-
105+
92106
# build darwin with CGO_ENABLED=1
93107
if [[ "${OS}" == "darwin" ]]; then
94108
CGO_ENABLED=1
95109
else
96-
CGO_ENABLED=0
110+
CGO_ENABLED=0
97111
fi
98-
112+
99113
# build the DevSpace binary
100114
CGO_ENABLED=${CGO_ENABLED} GOARCH=${ARCH} GOOS=${OS} ${GO_BUILD_CMD} -ldflags "${GO_BUILD_LDFLAGS}"\
101115
-o "${DEVSPACE_ROOT}/release/${NAME}" .

pkg/devspace/config/loader/variable/predefined_variable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var predefinedVars = map[string]PredefinedVariableFunction{
5555
},
5656
"DEVSPACE_KUBECTL_EXECUTABLE": func(ctx context.Context, options *PredefinedVariableOptions, logger log.Logger) (interface{}, error) {
5757
debugLog := logger.WithLevel(logrus.DebugLevel)
58-
path, err := downloader.NewDownloader(commands.NewKubectlCommand(), log.ToLogr(debugLog), constants.DefaultHomeDevSpaceFolder).EnsureCommand(ctx)
58+
path, err := downloader.NewDownloader(commands.NewKubectlCommand(), debugLog, constants.DefaultHomeDevSpaceFolder).EnsureCommand(ctx)
5959
if err != nil {
6060
debugLog.Debugf("Error downloading kubectl: %v", err)
6161
return "", nil

0 commit comments

Comments
 (0)