Skip to content

Update controller-pkg, Go, and dependencies - #70

Merged
richardcase merged 2 commits into
mainfrom
update-controller-pkg-go-1.26
Oct 26, 2026
Merged

richardcase merged 2 commits into
mainfrom
update-controller-pkg-go-1.26

Conversation

@richardcase

Copy link
Copy Markdown
Member

What this PR does

This PR moves the operator to the newest controller-pkg and makes the new microvm spec fields available in the API. It also moves Go to 1.26 and moves the dependencies and the tools to their newest versions.

New API fields

The new fields are available in the Microvm, MicrovmReplicaSet, MicrovmDeployment, and MicrovmTemplate CRDs:

  • provider: the microvm provider on the host. If the field is empty, flintlock uses the default provider.
  • allowGuestAgent: attaches a vsock device for the guest-agent.
  • cpuConfig.featuresToEnable and cpuConfig.kvmCapabilitiesToDisable: CPU feature configuration. The values are specific to the provider.
  • additionalVolumes[].mountPoint: the mount point of the volume in the guest.
  • additionalVolumes[].virtiofsPath: the virtiofs source of the volume. A volume image is not mandatory.

These fields are available only with flintlock v0.16.0 or a newer version on the host.

Dependency and tool versions

Item Before After
Go 1.19 1.26
controller-pkg weaveworks-liquidmetal, 2022-11-18 liquidmetal-dev, 2026-10-26
flintlock api and client weaveworks-liquidmetal, 2022-11-08 liquidmetal-dev, 2026-10-19
cluster-api v1.2.5 v1.14.3
controller-runtime v0.13.0 v0.24.1
k8s.io modules v0.25.0 v0.36.3
controller-gen v0.9.2 v0.23.0
kustomize v3.8.7 v5.8.3
counterfeiter not pinned v6.14.0

The k8s.io modules and controller-runtime are at the versions that cluster-api v1.14.3 uses. The newest kube-openapi module is for Go 1.27. Because of this, the direct dependencies are at the newest versions for Go 1.26.

Code changes

  • The conditions use the v1beta1 helpers of cluster-api and the condition types in api/core/v1beta2. The JSON schema of the status conditions does not change.
  • A local function reads the instance ID from the provider ID. The function noderefutil.NewProviderID is not in cluster-api v1.14.
  • The manager uses the metrics server options of controller-runtime.
  • The tests register the status subresource with the fake client and write the status through it.
  • The counterfeiter fake has the new ServerInfo method.
  • The Dockerfile copies the internal directory. Before this change, the image build was not possible.
  • The kustomization files use the kustomize v5 syntax.
  • A mise.toml file sets the Go version for this repository.
  • The README and the samples show the new spec fields.

Tests

  • make build and make test complete without errors. All 31 tests pass.
  • make generate and make manifests complete without errors.
  • kustomize build config/default completes without errors.
  • docker build . completes without errors.

Known problems that this PR does not correct

  • The file config/default/manager_auth_proxy_patch.yaml refers to the image gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0. This image is not available. make deploy will not work until the operator uses the metrics authentication of controller-runtime.
  • The module path of the operator is github.com/weaveworks-liquidmetal/microvm-operator. The repository is in the liquidmetal-dev organization.
  • Cluster-api will remove the v1beta1 condition helpers in a future version. A later change must move the conditions to metav1.Condition.

The operator uses the newest controller-pkg from the liquidmetal-dev
organization. The new fields of the microvm spec are available in the
Microvm, MicrovmReplicaSet, MicrovmDeployment, and MicrovmTemplate CRDs.
The new fields are provider, allowGuestAgent, cpuConfig, and the mountPoint
and virtiofsPath fields of additional volumes. These fields are available only with flintlock
v0.16.0 or a newer version on the host.

The project now builds with Go 1.26. The dependencies cluster-api,
controller-runtime, and the k8s.io modules are at their newest versions.
The tools controller-gen, kustomize, and counterfeiter are at their current
versions.

Changes to the code:

- The conditions use the v1beta1 helpers in cluster-api and the condition
  types in api/core/v1beta2. The status schema of the CRDs does not change.
- A local function reads the instance ID from the provider ID. The function
  noderefutil.NewProviderID is not in cluster-api v1.14.
- The manager uses the metrics server options of controller-runtime.
- The tests register the status subresource with the fake client.
- The counterfeiter fake has the new ServerInfo method.
- The Dockerfile copies the internal directory. Before this change, the
  image build failed.
- The kustomization files use the kustomize v5 syntax.
- The README and the samples show the new spec fields.
@richardcase richardcase added kind/dependencies Change/request only involves dependencies kind/chore Neither feature nor bug nor improvement. Busy work kind/feature New feature or request and removed kind/chore Neither feature nor bug nor improvement. Busy work kind/dependencies Change/request only involves dependencies labels Oct 26, 2026
The default token for workflows in this repository is read-only.
Because of this, the size labeler received a 403 error when it
added the size label to the PR. This change gives the workflow
read access to the contents and write access to the pull requests.
@richardcase
richardcase merged commit 624bb9c into main Oct 26, 2026
6 checks passed
@richardcase
richardcase deleted the update-controller-pkg-go-1.26 branch October 26, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New feature or request size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant