Skip to content

Commit 3dcd659

Browse files
committed
Fixed go-build
1 parent 0838ffc commit 3dcd659

File tree

5 files changed

+5
-1591
lines changed

5 files changed

+5
-1591
lines changed

build.gradle

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@ plugins {
2020

2121
dependencies {
2222
golang {
23-
build name:'github.com/kaloom/kubernetes-common', commit: 'LATEST_COMMIT'
24-
25-
build name:'k8s.io/client-go', commit:'271cb504b63ed762a3aea146bd842015da5a79c4'
26-
build name:'k8s.io/apimachinery', commit:'e9a29eff7d472df0f7da9ead5ab59b74e74a07ec'
27-
build name:'k8s.io/api', commit:'409c3b2393cd3359f275bd8b883b4d9c5aec41f6'
28-
build name:'k8s.io/apiserver', commit:'d299c880c4e33854f8c45bdd7ab599fb54cbe575'
29-
build name:'k8s.io/kubernetes', commit:'d515f0e3d2a2b3afc53fc839d6df6f34ed76c3bf'
30-
build name:'k8s.io/utils', commit:'1dbc8f1cec395db25b912b93257c400765c08146'
31-
build name:'k8s.io/apiextensions-apiserver', commit:'83f1a7e2b8384c17fb102b6616e08825ad12992d'
23+
build name:'github.com/google/go-cmp/cmp', commit:'LATEST_COMMIT'
3224
}
3325
}
3426

@@ -45,7 +37,7 @@ def buildDate = new Date().format("yyyy-MM-dd_HH:mm:ss.sss_Z", TimeZone.getTimeZ
4537
def ldflags = "-ldflags \"-X main.branch=${gitBranch} -X main.commit=${gitCommit} -X main.date=${buildDate}\""
4638

4739
build {
48-
go "build ${ldflags} -o ${project.binDir}/${project.execName} ${project.packageRepo}/${project.execName}"
40+
go "build ${ldflags} -mod=readonly -o ${project.binDir}/${project.execName} ${project.packageRepo}/${project.execName}"
4941
}
5042

5143
clean {

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ export GOBIN=${PWD}/bin
3939
export GOPATH=${PWD}/${GOGRADLE_PROJECT_PATH}
4040

4141
echo "Building $exec_name"
42-
go install -ldflags "${LDFLAGS}" "$@" ${repo_path}/${exec_name}
42+
go install -ldflags "${LDFLAGS}" -mod=readonly "$@" ${repo_path}/${exec_name}

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/kaloom/kubernetes-podagent
22

33
go 1.21
44

5-
toolchain go1.21.6
6-
75
require (
86
github.com/blang/semver v3.5.1+incompatible
97
github.com/containernetworking/cni v0.8.1

0 commit comments

Comments
 (0)