Skip to content

Commit 28da0c0

Browse files
authored
Merge branch 'main' into faiq/helm-values-include
2 parents 5a94246 + e005de2 commit 28da0c0

File tree

9 files changed

+53
-44
lines changed

9 files changed

+53
-44
lines changed

.goreleaser.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ before:
4141
name: caren-system
4242
$(helm template {{ .ProjectName }} ./charts/{{ .ProjectName }} \
4343
--namespace caren-system \
44-
--set-string image.tag=v{{ trimprefix .Version "v" }}{{ if .IsSnapshot }}-{{ .Env.GOARCH }} \
45-
--set-string helmRepositoryImage.tag=v{{ trimprefix .Version "v" }}{{ if .IsSnapshot }}-{{ .Env.GOARCH }} \
44+
--set-string image.tag=v{{ trimprefix .Version "v" }}{{ if .IsSnapshot }}-{{ .Runtime.Goarch }}{{ end }} \
45+
--set-string helmRepositoryImage.tag=v{{ trimprefix .Version "v" }}{{ if .IsSnapshot }}-{{ .Runtime.Goarch }} \
4646
--set-string image.repository=ko.local/{{ .ProjectName }}{{ end }} \
4747
)
4848
EOF'
@@ -80,12 +80,13 @@ builds:
8080
post:
8181
- |
8282
sh -ec 'if [ {{ .IsSnapshot }} == true ] && [ {{ .Runtime.Goarch }} == {{ .Arch }} ]; then
83-
env GOOS=linux GOARCH={{ .Arch }} \
84-
SOURCE_DATE_EPOCH=$(date +%s) \
83+
env SOURCE_DATE_EPOCH=$(date +%s) \
84+
KO_DATA_DATE_EPOCH=$(date +%s) \
8585
KO_DOCKER_REPO=ko.local/{{ .ProjectName }} \
8686
ko build \
8787
--bare \
88-
-t v{{ trimprefix .Version "v" }} \
88+
--platform linux/{{ .Arch }} \
89+
-t v{{ trimprefix .Version "v" }}-{{ .Arch }} \
8990
./cmd
9091
fi'
9192
@@ -135,16 +136,6 @@ docker_manifests:
135136
kos:
136137
- id: cluster-api-runtime-extensions-nutanix
137138
build: cluster-api-runtime-extensions-nutanix
138-
ldflags:
139-
- -s
140-
- -w
141-
- -X 'k8s.io/component-base/version.buildDate={{ .CommitDate }}'
142-
- -X 'k8s.io/component-base/version.gitCommit={{ .FullCommit }}'
143-
- -X 'k8s.io/component-base/version.gitTreeState={{ .Env.GIT_TREE_STATE }}'
144-
- -X 'k8s.io/component-base/version.gitVersion=v{{ trimprefix .Version "v" }}'
145-
- -X 'k8s.io/component-base/version.major={{ .Major }}'
146-
- -X 'k8s.io/component-base/version.minor={{ .Minor }}'
147-
- -X 'k8s.io/component-base/version/verflag.programName={{ .ProjectName }}'
148139
labels:
149140
org.opencontainers.image.created: "{{ .CommitDate }}"
150141
org.opencontainers.image.title: "{{ .ProjectName }}"
@@ -156,6 +147,8 @@ kos:
156147
- linux/arm64
157148
repository: ghcr.io/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix
158149
bare: true
150+
creation_time: "{{.CommitTimestamp}}"
151+
ko_data_creation_time: "{{.CommitTimestamp}}"
159152
tags:
160153
- 'v{{ trimprefix .Version "v" }}'
161154

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.13.2"
2+
".": "0.13.3"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.13.3 (2024-07-26)
4+
5+
<!-- Release notes generated using configuration in .github/release.yaml at main -->
6+
7+
## What's Changed
8+
### Fixes 🔧
9+
* fix: add cluster domain with final dot to no proxy list by @mhrabovcin in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/821
10+
### Other Changes
11+
* build: Ensure clean go build environment for goreleaser and ko by @jimmidyson in https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pull/824
12+
13+
14+
**Full Changelog**: https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/compare/v0.13.2...v0.13.3
15+
316
## 0.13.2 (2024-07-23)
417

518
<!-- Release notes generated using configuration in .github/release.yaml at main -->

api/v1alpha1/http_proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func (p *HTTPProxy) GenerateNoProxy(cluster *clusterv1.Cluster) []string {
6666
".svc",
6767
// append .svc.<SERVICE_DOMAIN>
6868
fmt.Sprintf(".svc.%s", strings.TrimLeft(serviceDomain, ".")),
69+
// append .svc.<SERVICE_DOMAIN>.
70+
fmt.Sprintf(".svc.%s.", strings.TrimLeft(serviceDomain, ".")),
6971
)
7072

7173
if cluster.Spec.InfrastructureRef == nil {

api/v1alpha1/http_proxy_test.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ func TestGenerateNoProxy(t *testing.T) {
2626
cluster: &clusterv1.Cluster{},
2727
expectedNoProxy: []string{
2828
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
29-
".svc", ".svc.cluster.local",
29+
".svc", ".svc.cluster.local", ".svc.cluster.local.",
3030
},
3131
}, {
3232
name: "no networking config with additional no proxy",
3333
cluster: &clusterv1.Cluster{},
3434
additonalNo: []string{"example.com"},
3535
expectedNoProxy: []string{
3636
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
37-
".svc", ".svc.cluster.local", "example.com",
37+
".svc", ".svc.cluster.local", ".svc.cluster.local.", "example.com",
3838
},
3939
}, {
4040
name: "custom pod network",
@@ -49,7 +49,7 @@ func TestGenerateNoProxy(t *testing.T) {
4949
},
5050
expectedNoProxy: []string{
5151
"localhost", "127.0.0.1", "10.0.0.0/24", "10.0.1.0/24", "kubernetes",
52-
"kubernetes.default", ".svc", ".svc.cluster.local",
52+
"kubernetes.default", ".svc", ".svc.cluster.local", ".svc.cluster.local.",
5353
},
5454
}, {
5555
name: "Unknown infrastructure cluster",
@@ -62,7 +62,7 @@ func TestGenerateNoProxy(t *testing.T) {
6262
},
6363
expectedNoProxy: []string{
6464
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
65-
".svc", ".svc.cluster.local",
65+
".svc", ".svc.cluster.local", ".svc.cluster.local.",
6666
},
6767
}, {
6868
name: "AWS cluster",
@@ -75,7 +75,7 @@ func TestGenerateNoProxy(t *testing.T) {
7575
},
7676
expectedNoProxy: []string{
7777
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
78-
".svc", ".svc.cluster.local", "169.254.169.254", ".elb.amazonaws.com",
78+
".svc", ".svc.cluster.local", ".svc.cluster.local.", "169.254.169.254", ".elb.amazonaws.com",
7979
},
8080
}, {
8181
name: "AWS managed (EKS) cluster",
@@ -88,7 +88,7 @@ func TestGenerateNoProxy(t *testing.T) {
8888
},
8989
expectedNoProxy: []string{
9090
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
91-
".svc", ".svc.cluster.local", "169.254.169.254", ".elb.amazonaws.com",
91+
".svc", ".svc.cluster.local", ".svc.cluster.local.", "169.254.169.254", ".elb.amazonaws.com",
9292
},
9393
}, {
9494
name: "Azure cluster",
@@ -101,7 +101,7 @@ func TestGenerateNoProxy(t *testing.T) {
101101
},
102102
expectedNoProxy: []string{
103103
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
104-
".svc", ".svc.cluster.local", "169.254.169.254",
104+
".svc", ".svc.cluster.local", ".svc.cluster.local.", "169.254.169.254",
105105
},
106106
}, {
107107
name: "Azure managed (AKS) cluster",
@@ -114,7 +114,7 @@ func TestGenerateNoProxy(t *testing.T) {
114114
},
115115
expectedNoProxy: []string{
116116
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
117-
".svc", ".svc.cluster.local", "169.254.169.254",
117+
".svc", ".svc.cluster.local", ".svc.cluster.local.", "169.254.169.254",
118118
},
119119
}, {
120120
name: "GCP cluster",
@@ -127,7 +127,8 @@ func TestGenerateNoProxy(t *testing.T) {
127127
},
128128
expectedNoProxy: []string{
129129
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
130-
".svc", ".svc.cluster.local", "169.254.169.254", "metadata", "metadata.google.internal",
130+
".svc", ".svc.cluster.local", ".svc.cluster.local.",
131+
"169.254.169.254", "metadata", "metadata.google.internal",
131132
},
132133
}, {
133134
name: "custom service network",
@@ -142,7 +143,7 @@ func TestGenerateNoProxy(t *testing.T) {
142143
},
143144
expectedNoProxy: []string{
144145
"localhost", "127.0.0.1", "172.16.0.0/24", "172.16.1.0/24", "kubernetes",
145-
"kubernetes.default", ".svc", ".svc.cluster.local",
146+
"kubernetes.default", ".svc", ".svc.cluster.local", ".svc.cluster.local.",
146147
},
147148
}, {
148149
name: "custom servicedomain",
@@ -155,7 +156,7 @@ func TestGenerateNoProxy(t *testing.T) {
155156
},
156157
expectedNoProxy: []string{
157158
"localhost", "127.0.0.1", "kubernetes", "kubernetes.default",
158-
".svc", ".svc.foo.bar",
159+
".svc", ".svc.foo.bar", ".svc.foo.bar.",
159160
},
160161
}, {
161162
name: "all options",
@@ -175,7 +176,7 @@ func TestGenerateNoProxy(t *testing.T) {
175176
additonalNo: []string{"example.com"},
176177
expectedNoProxy: []string{
177178
"localhost", "127.0.0.1", "10.10.0.0/16", "172.16.0.0/16", "kubernetes",
178-
"kubernetes.default", ".svc", ".svc.foo.bar", "example.com",
179+
"kubernetes.default", ".svc", ".svc.foo.bar", ".svc.foo.bar.", "example.com",
179180
},
180181
}}
181182

docs/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ archived_version = false
7070
# The version number for the version of the docs represented in this doc set.
7171
# Used in the "version-banner" partial to display a version number for the
7272
# current doc set.
73-
version = "0.13.2"
73+
version = "0.13.3"
7474

7575
# A link to latest version of the docs. Used in the "version-banner" partial to
7676
# point people to the main doc site.

make/dev.mk

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ dev.run-on-kind: kind.create clusterctl.init
77
ifndef SKIP_BUILD
88
dev.run-on-kind: release-snapshot
99
endif
10+
dev.run-on-kind: SNAPSHOT_VERSION := $(shell gojq -r '.version+"-"+.runtime.goarch' dist/metadata.json)
1011
dev.run-on-kind:
1112
kind load docker-image --name $(KIND_CLUSTER_NAME) \
12-
ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json) \
13-
ghcr.io/nutanix-cloud-native/caren-helm-reg:$$(gojq -r .version dist/metadata.json)-$(GOARCH)
13+
ko.local/cluster-api-runtime-extensions-nutanix:$(SNAPSHOT_VERSION) \
14+
ghcr.io/nutanix-cloud-native/caren-helm-reg:$(SNAPSHOT_VERSION)
1415
helm upgrade --install cluster-api-runtime-extensions-nutanix ./charts/cluster-api-runtime-extensions-nutanix \
1516
--set-string image.repository=ko.local/cluster-api-runtime-extensions-nutanix \
16-
--set-string image.tag=$$(gojq -r .version dist/metadata.json) \
17-
--set-string helmRepositoryImage.tag=$$(gojq -r .version dist/metadata.json)-$(GOARCH) \
17+
--set-string image.tag=$(SNAPSHOT_VERSION) \
18+
--set-string helmRepositoryImage.tag=$(SNAPSHOT_VERSION) \
1819
--wait --wait-for-jobs
1920
kubectl rollout restart deployment cluster-api-runtime-extensions-nutanix
2021
kubectl rollout restart deployment helm-repository
@@ -26,11 +27,12 @@ dev.update-webhook-image-on-kind: export KUBECONFIG := $(KIND_KUBECONFIG)
2627
ifndef SKIP_BUILD
2728
dev.update-webhook-image-on-kind: release-snapshot
2829
endif
30+
dev.update-webhook-image-on-kind: SNAPSHOT_VERSION := $(shell gojq -r '.version+"-"+.runtime.goarch' dist/metadata.json)
2931
dev.update-webhook-image-on-kind:
3032
kind load docker-image --name $(KIND_CLUSTER_NAME) \
31-
ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
33+
ko.local/cluster-api-runtime-extensions-nutanix:$(SNAPSHOT_VERSION)
3234
kubectl set image deployment \
33-
cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$$(gojq -r .version dist/metadata.json)
35+
cluster-api-runtime-extensions-nutanix webhook=ko.local/cluster-api-runtime-extensions-nutanix:$(SNAPSHOT_VERSION)
3436
kubectl rollout restart deployment cluster-api-runtime-extensions-nutanix
3537
kubectl rollout status deployment cluster-api-runtime-extensions-nutanix
3638

make/go.mk

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
# to be private (not available publicly) and should therefore not use the proxy or checksum database
66
export GOPRIVATE ?=
77

8+
# Always ensure that GOOS and GOARCH are unset in the evironment, otherwise this can cause issues
9+
# with goreleaser and ko building images for the wrong platform.
10+
override undefine GOOS
11+
override undefine GOARCH
12+
813
ALL_GO_SUBMODULES := $(shell find -mindepth 2 -maxdepth 2 -name go.mod -printf '%P\n' | sort)
914
GO_SUBMODULES_NO_DOCS := $(filter-out $(addsuffix /go.mod,docs),$(ALL_GO_SUBMODULES))
1015
THIRD_PARTY_GO_SUBMODULES := $(shell find hack/third-party -mindepth 2 -name go.mod -printf 'hack/third-party/%P\n' | sort)
1116

12-
ifndef GOOS
13-
export GOOS := $(OS)
14-
endif
15-
ifndef GOARCH
16-
export GOARCH := $(shell go env GOARCH)
17-
endif
18-
1917
define go_test
2018
source <(setup-envtest use -p env $(ENVTEST_VERSION)) && \
2119
gotestsum \
@@ -91,7 +89,7 @@ ifneq ($(SKIP_BUILD),true)
9189
$(MAKE) GORELEASER_FLAGS=$$'--config=<(env GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) gojq --yaml-input --yaml-output \'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=(["linux_amd64","linux_arm64",env.GOOS+"_"+env.GOARCH] | unique | map(. | sub("_amd64";"_amd64_v1")))\' .goreleaser.yml)' release-snapshot
9290
endif
9391
$(info $(M) $(if $(filter $(E2E_DRYRUN), true),dry-,)running e2e tests$(if $(E2E_LABEL), labelled "$(E2E_LABEL)")$(if $(E2E_FOCUS), matching "$(E2E_FOCUS)"))
94-
env E2E_IMAGE_TAG="$$(gojq --raw-output '.version' $(REPO_ROOT)/dist/metadata.json)" \
92+
env E2E_IMAGE_TAG="$$(gojq --raw-output '.version+"-"+.runtime.goarch' $(REPO_ROOT)/dist/metadata.json)" \
9593
envsubst -no-unset -no-empty -i '$(E2E_CONF_FILE)' -o '$(E2E_CONF_FILE_ENVSUBST)'
9694
env AWS_B64ENCODED_CREDENTIALS="$$(clusterawsadm bootstrap credentials encode-as-profile 2>/dev/null)" \
9795
ginkgo run \

test/e2e/config/caren.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ managementClusterName: caren-e2e
66
images:
77
- name: ko.local/cluster-api-runtime-extensions-nutanix:${E2E_IMAGE_TAG}
88
loadBehavior: mustLoad
9-
- name: ghcr.io/nutanix-cloud-native/caren-helm-reg:${E2E_IMAGE_TAG}-${GOARCH}
9+
- name: ghcr.io/nutanix-cloud-native/caren-helm-reg:${E2E_IMAGE_TAG}
1010
loadBehavior: mustLoad
1111

1212
providers:

0 commit comments

Comments
 (0)