Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/pr_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: pr_size

on: [pull_request]

permissions:
contents: read
pull-requests: write

jobs:
labeler:
runs-on: ubuntu-latest
Expand All @@ -15,4 +19,4 @@ jobs:
m_max_size: '1500'
l_max_size: '5000'
fail_if_xl: 'false'
message_if_xl: 'This PR is so big! Please, split it 😊'
message_if_xl: 'This PR is so big! Please, split it 😊'
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '1.19'
go-version-file: go.mod
- name: Build
run: make build
- name: Test
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.26 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -15,6 +15,7 @@ RUN go mod download
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY internal/ internal/

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.25.0
ENVTEST_K8S_VERSION = 1.36.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -134,8 +134,9 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
COUNTERFEITER := $(LOCALBIN)/counterfeiter

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
KUSTOMIZE_VERSION ?= v5.8.3
CONTROLLER_TOOLS_VERSION ?= v0.23.0
COUNTERFEITER_VERSION ?= v6.14.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -151,9 +152,9 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: counterfeiter
counterfeiter: $(COUNTERFEITER)
$(COUNTERFEITER): $(LOCALBIN)
cd $(LOCALBIN); go build -o . github.com/maxbrunsfeld/counterfeiter/v6
test -s $(LOCALBIN)/counterfeiter || GOBIN=$(LOCALBIN) go install github.com/maxbrunsfeld/counterfeiter/v6@$(COUNTERFEITER_VERSION)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@release-0.24
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ devices.

For now refer to the auto-generated [kubebuilder docs](/docs/kubebuilder.md).

### Microvm spec

The `Microvm` spec (and the `template.spec` of `MicrovmReplicaSet`,
`MicrovmDeployment` and `MicrovmTemplate`) embeds the shared
[controller-pkg](https://github.com/liquidmetal-dev/controller-pkg) microvm spec.
As well as the usual `vcpu`, `memoryMb`, `kernel`, `rootVolume`,
`additionalVolumes` and `networkInterfaces` fields it supports:

- `provider`: the microvm provider to use on the host. Unset means the host's default.
- `allowGuestAgent`: attach a vsock device so the in-guest guest-agent can talk to the host.
- `cpuConfig.featuresToEnable` / `cpuConfig.kvmCapabilitiesToDisable`: CPU feature tuning; values are provider specific.
- `additionalVolumes[].mountPoint`: guest path at which to mount the volume.
- `additionalVolumes[].virtiofsPath`: back the volume with a virtiofs share instead of a container `image`.

These fields need flintlock v0.16.0 or newer on the host. See
[config/samples](/config/samples) for examples.

## Contributing

Refer to the general [Liquid Metal contribution guides](https://weaveworks-liquidmetal.github.io/site/docs/category/guide-for-contributors/).
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package v1alpha1

import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
import clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"

const (
// MicrovmReadyCondition indicates that the microvm is in a running state.
Expand Down
14 changes: 7 additions & 7 deletions api/v1alpha1/microvm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ limitations under the License.
package v1alpha1

import (
flclient "github.com/weaveworks-liquidmetal/controller-pkg/client"
microvm "github.com/weaveworks-liquidmetal/controller-pkg/types/microvm"
flclient "github.com/liquidmetal-dev/controller-pkg/client"
microvm "github.com/liquidmetal-dev/controller-pkg/types/microvm"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

const (
Expand Down Expand Up @@ -190,12 +190,12 @@ func init() {
SchemeBuilder.Register(&Microvm{}, &MicrovmList{})
}

// GetConditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *Microvm) GetConditions() clusterv1.Conditions {
// GetV1Beta1Conditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *Microvm) GetV1Beta1Conditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *Microvm) SetConditions(conditions clusterv1.Conditions) {
// SetV1Beta1Conditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *Microvm) SetV1Beta1Conditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}
12 changes: 6 additions & 6 deletions api/v1alpha1/microvmdeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package v1alpha1

import (
microvm "github.com/weaveworks-liquidmetal/controller-pkg/types/microvm"
microvm "github.com/liquidmetal-dev/controller-pkg/types/microvm"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

const (
Expand Down Expand Up @@ -93,12 +93,12 @@ func init() {
SchemeBuilder.Register(&MicrovmDeployment{}, &MicrovmDeploymentList{})
}

// GetConditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *MicrovmDeployment) GetConditions() clusterv1.Conditions {
// GetV1Beta1Conditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *MicrovmDeployment) GetV1Beta1Conditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *MicrovmDeployment) SetConditions(conditions clusterv1.Conditions) {
// SetV1Beta1Conditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *MicrovmDeployment) SetV1Beta1Conditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}
12 changes: 6 additions & 6 deletions api/v1alpha1/microvmreplicaset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License.
package v1alpha1

import (
microvm "github.com/weaveworks-liquidmetal/controller-pkg/types/microvm"
microvm "github.com/liquidmetal-dev/controller-pkg/types/microvm"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

const (
Expand Down Expand Up @@ -91,12 +91,12 @@ func init() {
SchemeBuilder.Register(&MicrovmReplicaSet{}, &MicrovmReplicaSetList{})
}

// GetConditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *MicrovmReplicaSet) GetConditions() clusterv1.Conditions {
// GetV1Beta1Conditions returns the observations of the operational state of the MicrovmMachine resource.
func (r *MicrovmReplicaSet) GetV1Beta1Conditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *MicrovmReplicaSet) SetConditions(conditions clusterv1.Conditions) {
// SetV1Beta1Conditions sets the underlying service state of the MicrovmMachine to the predescribed clusterv1.Conditions.
func (r *MicrovmReplicaSet) SetV1Beta1Conditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}
13 changes: 6 additions & 7 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading