Skip to content

Commit

Permalink
Merge pull request #1933 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1908-to-release-1.1

[release-1.1] Show correct CCM/CNM version in apiserver
  • Loading branch information
k8s-ci-robot committed Jun 24, 2022
2 parents 7713385 + 7d6aa02 commit f78d4d4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions hack/pkg-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ else
fi

VERSION_PKG=sigs.k8s.io/cloud-provider-azure/pkg/version
CLIENT_GO_VERSION_PKG=k8s.io/client-go/pkg/version
BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"

LDFLAGS="-s -w"
LDFLAGS="$LDFLAGS -X $VERSION_PKG.gitVersion=${GIT_VERSION}"
LDFLAGS="$LDFLAGS -X $VERSION_PKG.gitCommit=${GIT_COMMIT}"
LDFLAGS="$LDFLAGS -X $VERSION_PKG.gitMajor=${VERSION_MAJOR}"
LDFLAGS="$LDFLAGS -X $VERSION_PKG.gitMinor=${VERSION_MINOR}"
LDFLAGS="$LDFLAGS -X $VERSION_PKG.buildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
LDFLAGS="$LDFLAGS -X ${VERSION_PKG}.gitVersion=${GIT_VERSION} -X ${CLIENT_GO_VERSION_PKG}.gitVersion=${GIT_VERSION}"
LDFLAGS="$LDFLAGS -X ${VERSION_PKG}.gitCommit=${GIT_COMMIT} -X ${CLIENT_GO_VERSION_PKG}.gitCommit=${GIT_COMMIT}"
LDFLAGS="$LDFLAGS -X ${VERSION_PKG}.gitMajor=${VERSION_MAJOR} -X ${CLIENT_GO_VERSION_PKG}.gitMajor=${VERSION_MAJOR}"
LDFLAGS="$LDFLAGS -X ${VERSION_PKG}.gitMinor=${VERSION_MINOR} -X ${CLIENT_GO_VERSION_PKG}.gitMinor=${VERSION_MINOR}"
LDFLAGS="$LDFLAGS -X ${VERSION_PKG}.buildDate=${BUILD_DATE} -X ${CLIENT_GO_VERSION_PKG}.buildDate=${BUILD_DATE}"
echo -ldflags \'$LDFLAGS\'

0 comments on commit f78d4d4

Please sign in to comment.