Skip to content

Commit e8452b8

Browse files
authored
Merge pull request #6 from charlie0129/tests
Test: add tests for utils and two actions
2 parents f991811 + 90b7aee commit e8452b8

27 files changed

+2709
-63
lines changed

.github/workflows/docs-check.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,23 @@ jobs:
2626
- name: Check boilerplate
2727
run: make checklicense
2828

29+
- name: Setup Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version: ${{ env.GO_VERSION }}
33+
34+
- name: Setup Go Caches
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
~/.cache/go-build
39+
~/go/pkg/mod
40+
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
41+
restore-keys: |
42+
${{ runner.os }}-golang-
43+
2944
# Currently not required
45+
# Will be required to auto-gen docs in the future
3046
- name: Run Go Generate
3147
run: make generate
3248

.github/workflows/go-checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ jobs:
4747
with:
4848
version: ${{ env.GOLANGCI_VERSION }}
4949

50-
- name: Run Go Generate
51-
run: make generate
50+
- name: Check Diff
51+
run: make checkdiff

.github/workflows/unit-test.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-*
8+
tags:
9+
- "v*"
10+
pull_request:
11+
branches:
12+
- main
13+
- release-*
14+
workflow_dispatch: { }
15+
16+
env:
17+
GO_VERSION: '1.17'
18+
GOLANGCI_VERSION: 'v1.47.2'
19+
20+
jobs:
21+
detect-noop:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
noop: ${{ steps.noop.outputs.should_skip }}
25+
steps:
26+
- name: Detect No-op Changes
27+
id: noop
28+
uses: fkirc/[email protected]
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg", "**.svg"]'
32+
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
33+
concurrent_skipping: false
34+
35+
unit-test:
36+
runs-on: ubuntu-latest
37+
needs: detect-noop
38+
if: needs.detect-noop.outputs.noop != 'true'
39+
steps:
40+
- name: Checkout Code
41+
uses: actions/checkout@v3
42+
43+
- name: Setup Go
44+
uses: actions/setup-go@v3
45+
with:
46+
go-version: ${{ env.GO_VERSION }}
47+
48+
- name: Setup Go Caches
49+
uses: actions/cache@v3
50+
with:
51+
path: |
52+
~/.cache/go-build
53+
~/go/pkg/mod
54+
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
55+
restore-keys: |
56+
${{ runner.os }}-golang-
57+
58+
- name: Cache envtest binaries
59+
uses: actions/cache@v3
60+
with:
61+
path: |
62+
~/.local/share/kubebuilder-envtest
63+
key: ${{ runner.os }}-kubebuilder-envtest-${{ hashFiles('Makefile') }}
64+
restore-keys: |
65+
${{ runner.os }}-kubebuilder-envtest-
66+
67+
- name: Install ginkgo
68+
run: |
69+
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
70+
71+
- name: Run tests
72+
run: make test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@ cscope.*
5656

5757
# Build output
5858
bin
59+
60+
# etcd
61+
default.etcd
62+

Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ MAKEFLAGS += --always-make
3030
# Use bash explicitly
3131
SHELL := /usr/bin/env bash -o errexit -o pipefail -o nounset
3232

33-
reviewable: generate checklicense lint svgformat
34-
3533
generate:
3634
./make-kt generate
3735
./make-mgr manifests generate
@@ -47,3 +45,26 @@ svgformat:
4745

4846
clean:
4947
rm -rf bin
48+
49+
reviewable: generate checklicense lint svgformat
50+
51+
checkdiff: generate
52+
git --no-pager diff
53+
if ! git diff --quiet; then \
54+
echo "Please run 'make reviewable' to include all changes"; \
55+
false; \
56+
fi
57+
58+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
59+
ENVTEST_K8S_VERSION = 1.24.1
60+
ENVTEST ?= bin/setup-envtest
61+
# Location to install dependencies to
62+
bin:
63+
mkdir -p bin
64+
65+
envtest: bin
66+
[ -f $(ENVTEST) ] || GOBIN=$(PWD)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
67+
68+
test: envtest
69+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \
70+
go test -coverprofile=cover.out ./...

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ User experience
309309
- [ ] Refine health status of CRs
310310
- [ ] Make it run as Addon, build component definition, and examples
311311
- [ ] Kubernetes dynamic admission control with validation webhook
312+
- [ ] Auto-generate usage docs of Sources, Filters, and Actions from CUE markers
313+
- [ ] Show available Sources, Filters, and Actions in cli
312314

313315
### v0.1.x
314316

controllers/kubetrigger/suite_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ import (
2121
"testing"
2222

2323
standardv1alpha1 "github.com/kubevela/kube-trigger/api/v1alpha1"
24-
. "github.com/onsi/ginkgo"
24+
. "github.com/onsi/ginkgo/v2"
2525
. "github.com/onsi/gomega"
2626
"k8s.io/client-go/kubernetes/scheme"
2727
"k8s.io/client-go/rest"
2828
"sigs.k8s.io/controller-runtime/pkg/client"
2929
"sigs.k8s.io/controller-runtime/pkg/envtest"
30-
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
3130
logf "sigs.k8s.io/controller-runtime/pkg/log"
3231
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3332
//+kubebuilder:scaffold:imports
@@ -42,18 +41,15 @@ var testEnv *envtest.Environment
4241

4342
func TestAPIs(t *testing.T) {
4443
RegisterFailHandler(Fail)
45-
46-
RunSpecsWithDefaultAndCustomReporters(t,
47-
"Controller Suite",
48-
[]Reporter{printer.NewlineReporter{}})
44+
RunSpecs(t, "Controller Suite")
4945
}
5046

5147
var _ = BeforeSuite(func() {
5248
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
5349

5450
By("bootstrapping test environment")
5551
testEnv = &envtest.Environment{
56-
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
52+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd")},
5753
ErrorIfCRDPathMissing: true,
5854
}
5955

@@ -72,7 +68,7 @@ var _ = BeforeSuite(func() {
7268
Expect(err).NotTo(HaveOccurred())
7369
Expect(k8sClient).NotTo(BeNil())
7470

75-
}, 60)
71+
})
7672

7773
var _ = AfterSuite(func() {
7874
By("tearing down the test environment")

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ require (
77
cuelang.org/go v0.4.3
88
github.com/imdario/mergo v0.3.12
99
github.com/oam-dev/kubevela-core-api v1.6.0-alpha.1
10-
github.com/onsi/ginkgo v1.16.5
11-
github.com/onsi/gomega v1.18.1
10+
github.com/onsi/ginkgo/v2 v2.1.4
11+
github.com/onsi/gomega v1.20.0
1212
github.com/pkg/errors v0.9.1
1313
github.com/sirupsen/logrus v1.9.0
1414
github.com/spf13/cobra v1.5.0
1515
github.com/spf13/pflag v1.0.5
16+
github.com/stretchr/testify v1.7.0
1617
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
1718
golang.org/x/time v0.0.0-20220609170525-579cf78fd858
1819
k8s.io/api v0.24.3
@@ -69,10 +70,10 @@ require (
6970
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
7071
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
7172
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
72-
github.com/nxadm/tail v1.4.8 // indirect
7373
github.com/oam-dev/cluster-gateway v1.4.0 // indirect
7474
github.com/oam-dev/terraform-controller v0.7.0 // indirect
7575
github.com/openshift/library-go v0.0.0-20220112153822-ac82336bd076 // indirect
76+
github.com/pmezard/go-difflib v1.0.0 // indirect
7677
github.com/prometheus/client_golang v1.12.1 // indirect
7778
github.com/prometheus/client_model v0.2.0 // indirect
7879
github.com/prometheus/common v0.32.1 // indirect
@@ -106,9 +107,8 @@ require (
106107
google.golang.org/grpc v1.47.0 // indirect
107108
google.golang.org/protobuf v1.28.1 // indirect
108109
gopkg.in/inf.v0 v0.9.1 // indirect
109-
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
110110
gopkg.in/yaml.v2 v2.4.0 // indirect
111-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
111+
gopkg.in/yaml.v3 v3.0.1 // indirect
112112
k8s.io/apiextensions-apiserver v0.24.2 // indirect
113113
k8s.io/apiserver v0.24.2 // indirect
114114
k8s.io/component-base v0.24.2 // indirect

go.sum

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG
558558
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
559559
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
560560
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
561+
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
561562
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
562563
github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4=
563564
github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ=
@@ -708,6 +709,7 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe
708709
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
709710
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
710711
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
712+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
711713
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
712714
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
713715
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
@@ -1050,8 +1052,10 @@ github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvw
10501052
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
10511053
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
10521054
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
1053-
github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ=
10541055
github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
1056+
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
1057+
github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
1058+
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
10551059
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
10561060
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
10571061
github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
@@ -1066,8 +1070,10 @@ github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQ
10661070
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
10671071
github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
10681072
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
1069-
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
10701073
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
1074+
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
1075+
github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q=
1076+
github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
10711077
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
10721078
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
10731079
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
@@ -1762,8 +1768,10 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc
17621768
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17631769
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17641770
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1771+
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17651772
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17661773
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1774+
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17671775
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17681776
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17691777
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1915,6 +1923,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
19151923
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
19161924
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM=
19171925
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
1926+
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
1927+
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
19181928
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
19191929
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
19201930
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -2179,8 +2189,9 @@ gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C
21792189
gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
21802190
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
21812191
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2182-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
21832192
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2193+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2194+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
21842195
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
21852196
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
21862197
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=

makefiles/consts.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
3838
VERSION ?= $(shell git describe --tags --always --dirty)
3939
IMG_VERSION ?= $(shell bash -c "\
4040
if [[ ! $(VERSION) =~ ^v[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-(alpha|beta)\.[0-9]{1,2})?$$ ]]; then \
41-
echo latest; \
42-
else \
43-
echo $(VERSION); \
41+
echo latest; \
42+
else \
43+
echo $(VERSION); \
4444
fi")
4545

4646
BIN_EXTENSION :=

0 commit comments

Comments
 (0)