Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit afe9582

Browse files
committed
Apple M1 build
1 parent a4fe5ce commit afe9582

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ build: generate fmt vet manifests
104104
-o bin/kubectl/kubectl-hns_darwin_amd64 \
105105
-ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \
106106
./cmd/kubectl/main.go
107+
GOOS=darwin GOARCH=arm64 go build \
108+
-o bin/kubectl/kubectl-hns_darwin_arm64 \
109+
-ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \
110+
./cmd/kubectl/main.go
107111
GOOS=linux GOARCH=arm64 go build \
108112
-o bin/kubectl/kubectl-hns_linux_arm64 \
109113
-ldflags="-X sigs.k8s.io/hierarchical-namespaces/internal/version.Version=${HNC_IMG_TAG}" \

cloudbuild.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ steps:
5151
- '-u'
5252
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
5353
- 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_linux_amd64'
54-
# Upload plugin (Darwin)
54+
# Upload plugin (Darwin intel)
5555
- name: gcr.io/cloud-builders/curl
5656
args:
5757
- '-X'
@@ -63,6 +63,18 @@ steps:
6363
- '-u'
6464
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
6565
- 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_amd64'
66+
# Upload plugin (Darwin arm64)
67+
- name: gcr.io/cloud-builders/curl
68+
args:
69+
- '-X'
70+
- 'POST'
71+
- '-H'
72+
- 'Content-Type: application/x-application'
73+
- '--data-binary'
74+
- '@hierarchical-namespaces/bin/kubectl/kubectl-hns_darwin_arm64'
75+
- '-u'
76+
- '$_HNC_USER:$_HNC_PERSONAL_ACCESS_TOKEN'
77+
- 'https://uploads.github.com/repos/$_HNC_REPO_OWNER/hierarchical-namespaces/releases/$_HNC_RELEASE_ID/assets?name=kubectl-hns_darwin_arm64'
6678
# Upload plugin (Windows)
6779
- name: gcr.io/cloud-builders/curl
6880
args:

hack/krew-kubectl-hns.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ spec:
5858
- from: "bin/kubectl/LICENSE"
5959
to: "."
6060
bin: "./kubectl-hns_darwin_amd64"
61+
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/hierarchical-namespaces/releases/download/HNC_IMG_TAG/kubectl-hns.tar.gz
62+
selector:
63+
matchLabels:
64+
os: darwin
65+
arch: arm64
66+
sha256: HNC_KREW_TAR_SHA256
67+
files:
68+
- from: "bin/kubectl/kubectl-hns_darwin_arm64"
69+
to: "."
70+
- from: "bin/kubectl/LICENSE"
71+
to: "."
72+
bin: "./kubectl-hns_darwin_arm64"
6173
- uri: https://github.com/HNC_RELEASE_REPO_OWNER/hierarchical-namespaces/releases/download/HNC_IMG_TAG/kubectl-hns.tar.gz
6274
selector:
6375
matchLabels:

0 commit comments

Comments
 (0)