Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register: build it with CGO #169

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ builds:
- main: ./cmd/operator
binary: elemental-operator
id: elemental-operator
env:
- CGO_ENABLED=0
ldflags:
- -w -s
- -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}}
Expand All @@ -20,6 +22,27 @@ builds:
- main: ./cmd/register
binary: elemental-register
id: elemental-register
env:
- CGO_ENABLED=1
ldflags:
- -w -s
- -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}}
- -X github.com/rancher/elemental-operator/pkg/version.Commit={{.Commit}}
- -X github.com/rancher/elemental-operator/pkg/version.CommitDate={{.CommitDate}}
goos:
- linux
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7
- main: ./cmd/support
binary: elemental-support
id: elemental-support
env:
- CGO_ENABLED=0
ldflags:
- -w -s
- -X github.com/rancher/elemental-operator/pkg/version.Version={{.Tag}}
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ build: operator register support

.PHONY: operator
operator:
go build -ldflags '$(LDFLAGS)' -o build/elemental-operator $(ROOT_DIR)/cmd/operator
CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o build/elemental-operator $(ROOT_DIR)/cmd/operator


.PHONY: register
register:
go build -ldflags '$(LDFLAGS)' -o build/elemental-register $(ROOT_DIR)/cmd/register
CGO_ENABLED=1 go build -ldflags '$(LDFLAGS)' -o build/elemental-register $(ROOT_DIR)/cmd/register
ldevulder marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: support
support:
go build -ldflags '$(LDFLAGS)' -o build/elemental-support $(ROOT_DIR)/cmd/support
CGO_ENABLED=0 go build -ldflags '$(LDFLAGS)' -o build/elemental-support $(ROOT_DIR)/cmd/support


.PHONY: build-docker-operator
Expand Down Expand Up @@ -113,4 +113,4 @@ kind-e2e-tests: build-docker-operator chart setup-kind
# thus losing any registration/inventories/os CRDs already created
reload-operator: build-docker-operator chart
kind load docker-image --name $(CLUSTER_NAME) ${REPO}:${TAG}
helm upgrade -n cattle-elemental-system elemental-operator $(CHART)
helm upgrade -n cattle-elemental-system elemental-operator $(CHART)