Skip to content

Commit f062103

Browse files
committed
Bump Go to 1.18.3 for Tiltfile, Container Images, Netlify, GH Action workflows
Also, updates the book. Signed-off-by: Nabarun Pal <[email protected]>
1 parent 4e26957 commit f062103

File tree

8 files changed

+85
-30
lines changed

8 files changed

+85
-30
lines changed

.github/workflows/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go 1.x
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: '1.17'
20+
go-version: '1.18'
2121
id: go
2222
- name: Check out code into the Go module directory
2323
uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install go
2121
uses: actions/setup-go@v3
2222
with:
23-
go-version: '^1.17'
23+
go-version: '^1.18'
2424
- name: generate release artifacts
2525
run: |
2626
make release

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SHELL:=/usr/bin/env bash
2323
#
2424
# Go.
2525
#
26-
GO_VERSION ?= 1.17.3
26+
GO_VERSION ?= 1.18.3
2727
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)
2828

2929
# Use GOPROXY environment variable if set

Tiltfile

Lines changed: 78 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ settings = {
1313
}
1414

1515
# global settings
16-
tilt_file = "./tilt-settings.yaml" if os.path.exists("./tilt-settings.yaml") else "./tilt-settings.json"
16+
tilt_file = "./tilt-settings.yaml" if os.path.exists(
17+
"./tilt-settings.yaml",
18+
) else "./tilt-settings.json"
1719
settings.update(read_yaml(
1820
tilt_file,
1921
default = {},
@@ -119,21 +121,27 @@ COPY --from=tilt-helper /usr/bin/kubectl /usr/bin/kubectl
119121
# ]
120122
# }
121123
# }
124+
122125
def load_provider_tiltfiles():
123126
provider_repos = settings.get("provider_repos", [])
124127

125128
for repo in provider_repos:
126-
file = repo + "/tilt-provider.yaml" if os.path.exists(repo + "/tilt-provider.yaml") else repo + "/tilt-provider.json"
129+
file = repo + "/tilt-provider.yaml" if os.path.exists(
130+
repo + "/tilt-provider.yaml",
131+
) else repo + "/tilt-provider.json"
127132
if not os.path.exists(file):
128-
fail("Failed to load provider. No tilt-provider.{yaml|json} file found in " + repo)
133+
fail(
134+
"Failed to load provider. No tilt-provider.{yaml|json} file found in " + repo,
135+
)
129136
provider_details = read_yaml(file, default = {})
130137
if type(provider_details) != type([]):
131138
provider_details = [provider_details]
132139
for item in provider_details:
133140
provider_name = item["name"]
134141
provider_config = item["config"]
135142
if "context" in provider_config:
136-
provider_config["context"] = repo + "/" + provider_config["context"]
143+
provider_config["context"] = repo + \
144+
"/" + provider_config["context"]
137145
else:
138146
provider_config["context"] = repo
139147
if "kustomize_config" not in provider_config:
@@ -144,7 +152,7 @@ def load_provider_tiltfiles():
144152

145153
tilt_helper_dockerfile_header = """
146154
# Tilt image
147-
FROM golang:1.17.3 as tilt-helper
155+
FROM golang:1.18.3 as tilt-helper
148156
# Support live reloading with Tilt
149157
RUN go get github.com/go-delve/delve/cmd/dlv
150158
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
@@ -166,6 +174,7 @@ COPY manager .
166174
# 1. Enables a local_resource go build of the provider's manager binary
167175
# 2. Configures a docker build for the provider, with live updating of the manager binary
168176
# 3. Runs kustomize for the provider's config/default and applies it
177+
169178
def enable_provider(name, debug):
170179
p = providers.get(name)
171180
context = p.get("context")
@@ -224,8 +233,14 @@ def enable_provider(name, debug):
224233
labels = [label, "ALL.binaries"],
225234
)
226235

227-
additional_docker_helper_commands = p.get("additional_docker_helper_commands", "")
228-
additional_docker_build_commands = p.get("additional_docker_build_commands", "")
236+
additional_docker_helper_commands = p.get(
237+
"additional_docker_helper_commands",
238+
"",
239+
)
240+
additional_docker_build_commands = p.get(
241+
"additional_docker_build_commands",
242+
"",
243+
)
229244

230245
dockerfile_contents = "\n".join([
231246
tilt_helper_dockerfile_header,
@@ -244,11 +259,13 @@ def enable_provider(name, debug):
244259
profiler_port = int(debug.get("profiler_port", 0))
245260
if metrics_port != 0:
246261
port_forwards.append(port_forward(metrics_port, 8080))
247-
links.append(link("http://localhost:" + str(metrics_port) + "/metrics", "metrics"))
262+
links.append(link("http://localhost:" +
263+
str(metrics_port) + "/metrics", "metrics"))
248264

249265
if profiler_port != 0:
250266
port_forwards.append(port_forward(profiler_port, 6060))
251-
links.append(link("http://localhost:" + str(profiler_port) + "/debug/pprof", "profiler"))
267+
links.append(link("http://localhost:" +
268+
str(profiler_port) + "/debug/pprof", "profiler"))
252269

253270
# Set up an image build for the provider. The live update configuration syncs the output from the local_resource
254271
# build into the container.
@@ -292,12 +309,14 @@ def find_object_qualified_name(objs, kind):
292309

293310
# Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will
294311
# not be checked in to version control.
312+
295313
def include_user_tilt_files():
296314
user_tiltfiles = listdir("tilt.d")
297315
for f in user_tiltfiles:
298316
include(f)
299317

300318
# Enable core cluster-api plus everything listed in 'enable_providers' in tilt-settings.json
319+
301320
def enable_providers():
302321
for name in get_providers():
303322
enable_provider(name, settings.get("debug").get(name, {}))
@@ -311,46 +330,79 @@ def deploy_provider_crds():
311330
# it is required to control precedence between creating this CRDs and creating providers.
312331
k8s_yaml(read_file("./.tiltbuild/yaml/clusterctl.crd.yaml"))
313332
k8s_resource(
314-
objects = ["providers.clusterctl.cluster.x-k8s.io:CustomResourceDefinition:default"],
333+
objects = [
334+
"providers.clusterctl.cluster.x-k8s.io:CustomResourceDefinition:default",
335+
],
315336
new_name = "provider_crd",
316337
)
317338

318339
def deploy_observability():
319340
if "promtail" in settings.get("deploy_observability", []):
320-
k8s_yaml(read_file("./.tiltbuild/yaml/promtail.observability.yaml"), allow_duplicates = True)
321-
k8s_resource(workload = "promtail", extra_pod_selectors = [{"app": "promtail"}], labels = ["observability"], resource_deps = ["loki"])
341+
k8s_yaml(read_file(
342+
"./.tiltbuild/yaml/promtail.observability.yaml",
343+
), allow_duplicates = True)
344+
k8s_resource(workload = "promtail", extra_pod_selectors = [
345+
{"app": "promtail"},
346+
], labels = ["observability"], resource_deps = ["loki"])
322347

323348
if "loki" in settings.get("deploy_observability", []):
324-
k8s_yaml(read_file("./.tiltbuild/yaml/loki.observability.yaml"), allow_duplicates = True)
325-
k8s_resource(workload = "loki", port_forwards = "3100", extra_pod_selectors = [{"app": "loki"}], labels = ["observability"])
349+
k8s_yaml(
350+
read_file("./.tiltbuild/yaml/loki.observability.yaml"),
351+
allow_duplicates = True,
352+
)
353+
k8s_resource(workload = "loki", port_forwards = "3100", extra_pod_selectors = [
354+
{"app": "loki"},
355+
], labels = ["observability"])
326356

327357
cmd_button(
328358
"loki:import logs",
329-
argv = ["sh", "-c", "cd ./hack/tools/log-push && go run ./main.go --log-path=$LOG_PATH"],
359+
argv = [
360+
"sh",
361+
"-c",
362+
"cd ./hack/tools/log-push && go run ./main.go --log-path=$LOG_PATH",
363+
],
330364
resource = "loki",
331365
icon_name = "import_export",
332366
text = "Import logs",
333367
inputs = [
334-
text_input("LOG_PATH", label = "Log path, one of: GCS path, ProwJob URL or local folder"),
368+
text_input(
369+
"LOG_PATH",
370+
label = "Log path, one of: GCS path, ProwJob URL or local folder",
371+
),
335372
],
336373
)
337374

338375
if "grafana" in settings.get("deploy_observability", []):
339-
k8s_yaml(read_file("./.tiltbuild/yaml/grafana.observability.yaml"), allow_duplicates = True)
340-
k8s_resource(workload = "grafana", port_forwards = "3001:3000", extra_pod_selectors = [{"app": "grafana"}], labels = ["observability"])
376+
k8s_yaml(read_file(
377+
"./.tiltbuild/yaml/grafana.observability.yaml",
378+
), allow_duplicates = True)
379+
k8s_resource(workload = "grafana", port_forwards = "3001:3000", extra_pod_selectors = [
380+
{"app": "grafana"},
381+
], labels = ["observability"])
341382

342383
if "prometheus" in settings.get("deploy_observability", []):
343-
k8s_yaml(read_file("./.tiltbuild/yaml/prometheus.observability.yaml"), allow_duplicates = True)
344-
k8s_resource(workload = "prometheus-server", new_name = "prometheus", port_forwards = "9090", extra_pod_selectors = [{"app": "prometheus"}], labels = ["observability"])
384+
k8s_yaml(read_file(
385+
"./.tiltbuild/yaml/prometheus.observability.yaml",
386+
), allow_duplicates = True)
387+
k8s_resource(
388+
workload = "prometheus-server",
389+
new_name = "prometheus",
390+
port_forwards = "9090",
391+
extra_pod_selectors = [{"app": "prometheus"}],
392+
labels = ["observability"],
393+
)
345394

346395
def prepare_all():
347396
allow_k8s_arg = ""
348397
if settings.get("allowed_contexts"):
349398
if type(settings.get("allowed_contexts")) == "string":
350-
allow_k8s_arg = "--allow-k8s-contexts={} ".format(settings.get("allowed_contexts"))
399+
allow_k8s_arg = "--allow-k8s-contexts={} ".format(
400+
settings.get("allowed_contexts"),
401+
)
351402
if type(settings.get("allowed_contexts")) == "list":
352403
for context in settings.get("allowed_contexts"):
353-
allow_k8s_arg = allow_k8s_arg + "--allow-k8s-contexts={} ".format(context)
404+
allow_k8s_arg = allow_k8s_arg + \
405+
"--allow-k8s-contexts={} ".format(context)
354406

355407
tools_arg = "--tools kustomize,envsubst "
356408
cert_manager_arg = ""
@@ -361,7 +413,10 @@ def prepare_all():
361413
# a dependency between these resources and provider resources.
362414
kustomize_build_arg = "--kustomize-builds clusterctl.crd:./cmd/clusterctl/config/crd/ "
363415
for tool in settings.get("deploy_observability", []):
364-
kustomize_build_arg = kustomize_build_arg + "--kustomize-builds {tool}.observability:./hack/observability/{tool}/ ".format(tool = tool)
416+
kustomize_build_arg = kustomize_build_arg + \
417+
"--kustomize-builds {tool}.observability:./hack/observability/{tool}/ ".format(
418+
tool = tool,
419+
)
365420
providers_arg = ""
366421
for name in get_providers():
367422
p = providers.get(name)

docs/book/src/developer/providers/v1.1-to-v1.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maintainers of providers and consumers of our Go API.
99

1010
## Minimum Go version
1111

12-
* The Go version used by Cluster API is now Go 1.17.x
12+
* The Go version used by Cluster API is now Go 1.18.x
1313

1414
## Dependencies
1515

hack/ensure-go.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ EOF
3131
local go_version
3232
IFS=" " read -ra go_version <<< "$(go version)"
3333
local minimum_go_version
34-
minimum_go_version=go1.16.0
34+
minimum_go_version=go1.18.3
3535
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
3636
cat <<EOF
3737
Detected go version: ${go_version[*]}.

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
publish = "docs/book/book"
55

66
[build.environment]
7-
GO_VERSION = "1.17"
7+
GO_VERSION = "1.18"
88

99
# Standard Netlify redirects
1010
[[redirects]]

test/infrastructure/docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ROOT = ../../..
1919

2020
.DEFAULT_GOAL:=help
2121

22-
GO_VERSION ?= 1.17.3
22+
GO_VERSION ?= 1.18.3
2323
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)
2424

2525
# Use GOPROXY environment variable if set

0 commit comments

Comments
 (0)