A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/kubernetes-sigs/kubebuilder/commit/0ace7a8753c52b35014e43edc2a0b0454b78e769 below:

Merge pull request #4576 from kubernetes-sigs/revert-4481-make-go-ins… · kubernetes-sigs/kubebuilder@0ace7a8 · GitHub

File tree Expand file treeCollapse file tree 6 files changed

+21

-53

lines changed

Filter options

Expand file treeCollapse file tree 6 files changed

+21

-53

lines changed Original file line number Diff line number Diff line change

@@ -46,15 +46,15 @@ help: ## Display this help

46 46

##@ Build

47 47 48 48

LD_FLAGS=-ldflags " \

49 -

-X cmd.kubeBuilderVersion=$(shell git describe --tags --dirty --broken) \

50 -

-X cmd.goos=$(shell go env GOOS) \

51 -

-X cmd.goarch=$(shell go env GOARCH) \

52 -

-X cmd.gitCommit=$(shell git rev-parse HEAD) \

53 -

-X cmd.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \

49 +

-X main.kubeBuilderVersion=$(shell git describe --tags --dirty --broken) \

50 +

-X main.goos=$(shell go env GOOS) \

51 +

-X main.goarch=$(shell go env GOARCH) \

52 +

-X main.gitCommit=$(shell git rev-parse HEAD) \

53 +

-X main.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \

54 54

"

55 55

.PHONY: build

56 56

build: ## Build the project locally

57 -

go build $(LD_FLAGS) -o bin/kubebuilder

57 +

go build $(LD_FLAGS) -o bin/kubebuilder ./cmd

58 58 59 59

.PHONY: install

60 60

install: build ## Build and install the binary with the current source code. Use it to test your changes locally.

Original file line number Diff line number Diff line change

@@ -29,15 +29,16 @@ before:

29 29

# Build a binary for each target in targets.

30 30

builds:

31 31

- id: kubebuilder

32 +

main: ./cmd

32 33

binary: kubebuilder

33 34

mod_timestamp: "{{ .CommitTimestamp }}"

34 35

ldflags:

35 -

- -X cmd.kubeBuilderVersion={{ .Version }}

36 -

- -X cmd.goos={{ .Os }}

37 -

- -X cmd.goarch={{ .Arch }}

38 -

- -X cmd.gitCommit={{ .Commit }}

39 -

- -X cmd.buildDate={{ .Date }}

40 -

- -X cmd.kubernetesVendorVersion={{ .Env.KUBERNETES_VERSION }}

36 +

- -X main.kubeBuilderVersion={{ .Version }}

37 +

- -X main.goos={{ .Os }}

38 +

- -X main.goarch={{ .Arch }}

39 +

- -X main.gitCommit={{ .Commit }}

40 +

- -X main.buildDate={{ .Date }}

41 +

- -X main.kubernetesVendorVersion={{ .Env.KUBERNETES_VERSION }}

41 42

targets:

42 43

- linux_amd64

43 44

- linux_arm64

Original file line number Diff line number Diff line change

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and

14 14

limitations under the License.

15 15

*/

16 16 17 -

package cmd

17 +

package main

18 18 19 19

import (

20 20

"github.com/sirupsen/logrus"

@@ -36,8 +36,7 @@ func init() {

36 36

logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})

37 37

}

38 38 39 -

// Run bootstraps & runs the CLI

40 -

func Run() {

39 +

func main() {

41 40

// Bundle plugin which built the golang projects scaffold with base.go/v4 and kustomize/v2 plugins

42 41

gov4Bundle, _ := plugin.NewBundleWithOptions(plugin.WithName(golang.DefaultNameQualifier),

43 42

plugin.WithVersion(plugin.Version{Number: 4}),

Original file line number Diff line number Diff line change

@@ -14,22 +14,19 @@ See the License for the specific language governing permissions and

14 14

limitations under the License.

15 15

*/

16 16 17 -

package cmd

17 +

package main

18 18 19 19

import (

20 20

"fmt"

21 -

"runtime/debug"

22 21

)

23 22 24 -

const unknown = "unknown"

25 - 26 23

// var needs to be used instead of const as ldflags is used to fill this

27 24

// information in the release process

28 25

var (

29 -

kubeBuilderVersion = unknown

30 -

kubernetesVendorVersion = unknown

31 -

goos = unknown

32 -

goarch = unknown

26 +

kubeBuilderVersion = "unknown"

27 +

kubernetesVendorVersion = "unknown"

28 +

goos = "unknown"

29 +

goarch = "unknown"

33 30

gitCommit = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD)

34 31 35 32

buildDate = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')

@@ -47,12 +44,6 @@ type version struct {

47 44 48 45

// versionString returns the CLI version

49 46

func versionString() string {

50 -

if kubeBuilderVersion == unknown {

51 -

if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "" {

52 -

kubeBuilderVersion = info.Main.Version

53 -

}

54 -

}

55 - 56 47

return fmt.Sprintf("Version: %#v", version{

57 48

kubeBuilderVersion,

58 49

kubernetesVendorVersion,

Original file line number Diff line number Diff line change

@@ -109,7 +109,7 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}

109 109

function build_kb {

110 110

header_text "Building kubebuilder"

111 111 112 -

go build -o "${kb_root_dir}/bin/kubebuilder"

112 +

go build -o "${kb_root_dir}/bin/kubebuilder" ./cmd

113 113

kb="${kb_root_dir}/bin/kubebuilder"

114 114

}

115 115

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4