Skip to content
Open
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
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ replace (
golang.zx2c4.com/wireguard/wgctrl => github.com/siderolabs/wgctrl-go v0.0.0-20251029173431-c4fd5f6a4e72
)

replace github.com/cosi-project/runtime => github.com/smira/os-runtime v0.0.0-20260805105338-c3f9cbb4a1f7

// Kubernetes dependencies sharing the same version.
require (
k8s.io/api v0.37.0-beta.0
Expand Down Expand Up @@ -192,7 +194,7 @@ require (
golang.org/x/text v0.40.0
golang.org/x/time v0.15.0
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10
google.golang.org/grpc v1.82.1
google.golang.org/grpc v1.83.0
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af
gopkg.in/typ.v4 v4.4.0
k8s.io/klog/v2 v2.140.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA=
github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w=
github.com/cosi-project/runtime v1.16.2 h1:sgjOMrnaElrja93kkJJJIQYwd45PhpGl9cBci9yqn5c=
github.com/cosi-project/runtime v1.16.2/go.mod h1:+GrSnmJjMfWMe6NubevwwXQf/v7afddDLeCbLonvvps=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
Expand Down Expand Up @@ -882,6 +880,8 @@ github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w
github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
github.com/smira/kobject v0.0.0-20240304111826-49c8d4613389 h1:f/5NRv5IGZxbjBhc5MnlbNmyuXBPxvekhBAUzyKWyLY=
github.com/smira/kobject v0.0.0-20240304111826-49c8d4613389/go.mod h1:+SexPO1ZvdbbWUdUnyXEWv3+4NwHZjKhxOmQqHY4Pqc=
github.com/smira/os-runtime v0.0.0-20260805105338-c3f9cbb4a1f7 h1:K2DNrOa5L579Jd3ZINBjN8CI2+n2B88/Wv4/IVvGxZU=
github.com/smira/os-runtime v0.0.0-20260805105338-c3f9cbb4a1f7/go.mod h1:rHqlcEfmTZxBdpsXVmfww1Ji0MpmiD/mUWQ+NFaUUP0=
github.com/smira/siv-go v0.0.0-20260706144621-2093d2730928 h1:jLGRk/3hqXLnAjFhChWXFLc+uUbKeyQIvCBciG/CsPs=
github.com/smira/siv-go v0.0.0-20260706144621-2093d2730928/go.mod h1:aI+8yClBW+1uovkHw6HM01YXnYB8vohtB9C83wzx34E=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
Expand Down Expand Up @@ -1338,8 +1338,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE=
google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA=
google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ=
google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/cosi-project/runtime/pkg/resource/rtestutils"
"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/cosi-project/runtime/pkg/state/owned"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -31,7 +30,7 @@ func TestVolumeMounter(t *testing.T) {
t.Parallel()

logger := zaptest.NewLogger(t)
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
t.Cleanup(cancel)

Expand Down Expand Up @@ -126,7 +125,7 @@ func TestVolumeMounterReadWrite(t *testing.T) {
t.Parallel()

logger := zaptest.NewLogger(t)
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
t.Cleanup(cancel)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/cosi-project/runtime/pkg/resource"
"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/siderolabs/gen/xslices"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -65,7 +64,7 @@ func TestVolumeConfigSuite(t *testing.T) {
suite.Require().NoError(f.Truncate(1024 * 1024))
suite.Require().NoError(f.Close())

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

m, err := intmeta.New(t.Context(), st, intmeta.WithFixedPath(path))
suite.Require().NoError(err)
Expand Down
9 changes: 1 addition & 8 deletions internal/app/machined/pkg/controllers/ctest/ctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cosi-project/runtime/pkg/safe"
"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/siderolabs/go-retry/retry"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -52,13 +51,7 @@ func (suite *DefaultSuite) SetupTest() {

suite.ctx, suite.ctxCancel = context.WithTimeout(context.Background(), suite.Timeout)

suite.state = state.WrapCore(namespaced.NewState(
func(ns resource.Namespace) state.CoreState {
return inmem.NewStateWithOptions(
inmem.WithHistoryMaxCapacity(1000),
)(ns)
},
))
suite.state = state.WrapCore(inmem.NewState())

Comment thread
smira marked this conversation as resolved.
var err error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/siderolabs/go-retry/retry"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -49,7 +48,7 @@ func TestUpgradeFallbackControllerSuite(t *testing.T) {
require.NoError(t, f.Truncate(1024*1024))
require.NoError(t, f.Close())

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

m, err := meta.New(t.Context(), st, meta.WithFixedPath(path))
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

Expand Down Expand Up @@ -83,7 +82,7 @@ func TestAddressOverlapCheck(t *testing.T) {
t.Parallel()

logger := zaptest.NewLogger(t)
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

in, err := generate.NewInput("test-cluster", "https://localhost", constants.DefaultKubernetesVersion)
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.yaml.in/yaml/v4"
Expand Down Expand Up @@ -43,7 +42,7 @@ func TestParseMetadata(t *testing.T) {

ctx := t.Context()

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

eth1 := network.NewLinkStatus(network.NamespaceName, "eth1")
eth1.TypedSpec().PermanentAddr = nethelpers.HardwareAddr{0x68, 0x05, 0xca, 0xb8, 0xf1, 0xf8}
Expand Down Expand Up @@ -71,7 +70,7 @@ func TestParseMetadata2Bonds(t *testing.T) {

ctx := t.Context()

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

eth0 := network.NewLinkStatus(network.NamespaceName, "eth0")
eth0.TypedSpec().PermanentAddr = nethelpers.HardwareAddr{0xe4, 0x43, 0x4b, 0xd0, 0x7b, 0x50}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -33,7 +32,7 @@ func TestNetworkConfig(t *testing.T) {

ch := make(chan *runtime.PlatformNetworkConfig, 1)

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

uuid := hardware.NewSystemInformation(hardware.SystemInformationID)
uuid.TypedSpec().UUID = "0123-4567-89ab-cdef"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -73,7 +72,7 @@ func TestMapValues(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

ctx, cancel := context.WithTimeout(t.Context(), 5*time.Second)
defer cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cosi-project/runtime/pkg/safe"
"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -91,7 +90,7 @@ func TestPopulate(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

ctx, cancel := context.WithTimeout(t.Context(), 5*time.Second)
defer cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/cosi-project/runtime/pkg/resource"
"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/siderolabs/go-procfs/procfs"
"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -72,7 +71,7 @@ func setup(ctx context.Context, t *testing.T, st state.State, mockUUID, mockSeri
}

func TestRepopulateOnRetry(t *testing.T) {
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

ctx, cancel := context.WithTimeout(t.Context(), 5*time.Second)
defer cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/siderolabs/gen/xtesting/must"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -110,7 +109,7 @@ func TestParseNetworkConfig(t *testing.T) {

n := &nocloud.Nocloud{}

st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

devicesReady := runtime.NewDevicesStatus(runtime.NamespaceName, runtime.DevicesID)
devicesReady.TypedSpec().Ready = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -34,7 +33,7 @@ func TestParseAliases(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

alias0IPv4 := network.AddressSpecSpec{
Address: netip.MustParsePrefix("192.168.1.100/24"),
Expand Down Expand Up @@ -281,7 +280,7 @@ func TestParseErrors(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

t.Run("malformed alias IPv4 returns descriptive error", func(t *testing.T) {
t.Parallel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -20,7 +19,7 @@ func TestDNSMerge(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

mac := `ETH0_MAC = "02:00:c0:a8:01:5c"
ETH0_IP = "192.168.1.92"
Expand Down Expand Up @@ -117,7 +116,7 @@ func TestDNSMergeError(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

base := `ETH0_MAC = "02:00:c0:a8:01:5c"
ETH0_IP = "192.168.1.92"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -26,7 +25,7 @@ func TestSanitizeHostname(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

for _, tc := range []struct {
name string
Expand Down Expand Up @@ -94,7 +93,7 @@ func TestParseMetadataHostname(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

for _, tc := range []struct {
name string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -33,7 +32,7 @@ func TestParseIPv6(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

gw6Route := func(gw string, priority uint32) network.RouteSpecSpec {
return network.RouteSpecSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/cosi-project/runtime/pkg/state"
"github.com/cosi-project/runtime/pkg/state/impl/inmem"
"github.com/cosi-project/runtime/pkg/state/impl/namespaced"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -63,7 +62,7 @@ func TestOnegateProxyRoute(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

tests := []struct {
name string
Expand Down Expand Up @@ -133,7 +132,7 @@ func TestOnegateRouteAttachedToFirstStaticInterface(t *testing.T) {
t.Parallel()

o := &opennebula.OpenNebula{}
st := state.WrapCore(namespaced.NewState(inmem.Build))
st := state.WrapCore(inmem.NewState())

// ETH0=dhcp, ETH1=static — route must be on eth1 (first static).
ctx := []byte(`ETH0_MAC = "02:00:c0:a8:01:5c"
Expand Down
Loading