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
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ replace (
// this a fork with containerd 2.2 branch + the commit from the PR above
replace github.com/containerd/containerd/v2 => github.com/smira/containerd/v2 v2.0.0-20251218145129-b4f1f2900b80

replace github.com/cosi-project/state-sqlite => github.com/smira/state-sqlite v0.0.0-20260108201100-39b5e8be2658

// Kubernetes dependencies sharing the same version.
require (
k8s.io/api v0.35.0
Expand Down Expand Up @@ -68,6 +70,7 @@ require (
github.com/coredns/coredns v1.13.2
github.com/coreos/go-iptables v0.8.0
github.com/cosi-project/runtime v1.13.0
github.com/cosi-project/state-sqlite v0.1.1
github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e
github.com/diskfs/go-diskfs v1.7.1-0.20251223133332-fc569a00ea19
github.com/distribution/reference v0.6.0
Expand Down Expand Up @@ -194,6 +197,7 @@ require (
kernel.org/pub/linux/libs/security/libcap/cap v1.2.77
sigs.k8s.io/cli-utils v0.37.3-0.20250918194211-77c836a69463
sigs.k8s.io/hydrophone v0.7.0
zombiezen.com/go/sqlite v1.4.2
)

require (
Expand Down Expand Up @@ -316,6 +320,7 @@ require (
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect
github.com/opencontainers/selinux v1.13.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
Expand All @@ -329,6 +334,7 @@ require (
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.4 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.5 // indirect
Expand Down Expand Up @@ -359,7 +365,7 @@ require (
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/tools v0.39.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
Expand All @@ -374,6 +380,10 @@ require (
k8s.io/component-helpers v0.35.0 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
kernel.org/pub/linux/libs/security/libcap/psx v1.2.77 // indirect
modernc.org/libc v1.66.10 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.41.0 // indirect
rsc.io/qr v0.2.0 // indirect
sigs.k8s.io/controller-runtime v0.22.2 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
Expand Down
38 changes: 36 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/nberlee/go-netstat v0.1.2 h1:wgPV1YOUo+kDFypqiKgfxMtnSs1Wb42c7ahI4qyEUJc=
github.com/nberlee/go-netstat v0.1.2/go.mod h1:GvDCRLsUKMRN1wULkt7tpnDmjSIE6YGf5zeVq+mBO64=
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
Expand Down Expand Up @@ -601,6 +603,8 @@ github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+L
github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/tview v0.42.0 h1:b/ftp+RxtDsHSaynXTbJb+/n/BxDEi+W3UfF5jILK6c=
github.com/rivo/tview v0.42.0/go.mod h1:cSfIYfhpSGCjp3r/ECJb+GKS7cGJnqV8vfjQPwoXyfY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
Expand Down Expand Up @@ -697,6 +701,8 @@ github.com/smira/containerd/v2 v2.0.0-20251218145129-b4f1f2900b80 h1:8abfvG51P0E
github.com/smira/containerd/v2 v2.0.0-20251218145129-b4f1f2900b80/go.mod h1:YCMjKjA4ZA7egdHNi3/93bJR1+2oniYlnS+c0N62HdE=
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/state-sqlite v0.0.0-20260108201100-39b5e8be2658 h1:FulDaI0zmvAit630Q47RbI8PwHstyjSGubpRgJsNVQQ=
github.com/smira/state-sqlite v0.0.0-20260108201100-39b5e8be2658/go.mod h1:rPILL0s4dh1dPTW8pOPJY+bUGvoEPxYiXa/R1MCy8rI=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down Expand Up @@ -822,8 +828,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down Expand Up @@ -1095,6 +1101,32 @@ kernel.org/pub/linux/libs/security/libcap/cap v1.2.77 h1:iQtQTjFUOcTT19fI8sTCzYX
kernel.org/pub/linux/libs/security/libcap/cap v1.2.77/go.mod h1:oV+IO8kGh0B7TxErbydDe2+BRmi9g/W0CkpVV+QBTJU=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.77 h1:Z06sMOzc0GNCwp6efaVrIrz4ywGJ1v+DP0pjVkOfDuA=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.77/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
modernc.org/cc/v4 v4.26.5 h1:xM3bX7Mve6G8K8b+T11ReenJOT+BmVqQj0FY5T4+5Y4=
modernc.org/cc/v4 v4.26.5/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
modernc.org/ccgo/v4 v4.28.1 h1:wPKYn5EC/mYTqBO373jKjvX2n+3+aK7+sICCv4Fjy1A=
modernc.org/ccgo/v4 v4.28.1/go.mod h1:uD+4RnfrVgE6ec9NGguUNdhqzNIeeomeXf6CL0GTE5Q=
modernc.org/fileutil v1.3.40 h1:ZGMswMNc9JOCrcrakF1HrvmergNLAmxOPjizirpfqBA=
modernc.org/fileutil v1.3.40/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc=
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
modernc.org/libc v1.66.10 h1:yZkb3YeLx4oynyR+iUsXsybsX4Ubx7MQlSYEw4yj59A=
modernc.org/libc v1.66.10/go.mod h1:8vGSEwvoUoltr4dlywvHqjtAqHBaw0j1jI7iFBTAr2I=
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
modernc.org/sqlite v1.41.0 h1:bJXddp4ZpsqMsNN1vS0jWo4IJTZzb8nWpcgvyCFG9Ck=
modernc.org/sqlite v1.41.0/go.mod h1:9fjQZ0mB1LLP0GYrp39oOJXx/I2sxEnZtzCmEQIKvGE=
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY=
Expand All @@ -1119,3 +1151,5 @@ sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
zombiezen.com/go/sqlite v1.4.2 h1:KZXLrBuJ7tKNEm+VJcApLMeQbhmAUOKA5VWS93DfFRo=
zombiezen.com/go/sqlite v1.4.2/go.mod h1:5Kd4taTAD4MkBzT25mQ9uaAlLjyR0rFhsR6iINO70jc=
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func callbackWithMountStatus(mountStatus *block.VolumeMountStatus) func(
//
// Transitions to: removeMountRequest.
func removeMountStatusFinalizer(ctx context.Context, r controller.ReaderWriter, logger *zap.Logger, mountContext volumeMountContext) (automaton.ControllerStateFunc[volumeMountContext], error) {
if err := r.RemoveFinalizer(ctx, block.NewVolumeMountStatus(block.NamespaceName, mountContext.mountID).Metadata(), mountContext.requester); err != nil {
if err := r.RemoveFinalizer(ctx, block.NewVolumeMountStatus(mountContext.mountID).Metadata(), mountContext.requester); err != nil {
return nil, fmt.Errorf("error removing finalizer: %w", err)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestVolumeMounter(t *testing.T) {
// no-op run, as the volume mount status doesn't exist
require.NoError(t, volumeMounter.Run(ctx, adapter, logger))

vms := block.NewVolumeMountStatus(block.NamespaceName, mountID)
vms := block.NewVolumeMountStatus(mountID)
require.NoError(t, st.Create(ctx, vms))

// 2nd run, should put a finalizer on the volume mount status and call the callback 1st time
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestVolumeMounterReadWrite(t *testing.T) {

require.NoError(t, st.AddFinalizer(ctx, block.NewVolumeMountRequest(block.NamespaceName, mountID).Metadata(), "test"))

vms := block.NewVolumeMountStatus(block.NamespaceName, mountID)
vms := block.NewVolumeMountStatus(mountID)
vms.TypedSpec().ReadOnly = true // volume is mounted read-only (from some other request)
require.NoError(t, st.Create(ctx, vms))

Expand Down
9 changes: 5 additions & 4 deletions internal/app/machined/pkg/controllers/block/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/siderolabs/talos/internal/pkg/selinux"
"github.com/siderolabs/talos/pkg/filetree"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources"
"github.com/siderolabs/talos/pkg/machinery/resources/block"
"github.com/siderolabs/talos/pkg/xfs"
"github.com/siderolabs/talos/pkg/xfs/fsopen"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (ctrl *MountController) Inputs() []controller.Input {
Kind: controller.InputStrong,
},
{
Namespace: block.NamespaceName,
Namespace: resources.InMemoryNamespace,
Type: block.MountStatusType,
Kind: controller.InputStrong,
},
Expand Down Expand Up @@ -227,7 +228,7 @@ func (ctrl *MountController) Run(ctx context.Context, r controller.Runtime, logg
}

if err = safe.WriterModify(
ctx, r, block.NewMountStatus(block.NamespaceName, mountRequest.Metadata().ID()),
ctx, r, block.NewMountStatus(mountRequest.Metadata().ID()),
func(mountStatus *block.MountStatus) error {
mountStatus.TypedSpec().Spec = *mountRequest.TypedSpec()
mountStatus.TypedSpec().Source = mountSource
Expand Down Expand Up @@ -261,7 +262,7 @@ func (ctrl *MountController) Run(ctx context.Context, r controller.Runtime, logg
func (ctrl *MountController) tearDownMountStatus(ctx context.Context, r controller.Runtime, logger *zap.Logger, mountRequest *block.MountRequest) (bool, error) {
logger = logger.With(zap.String("mount_request", mountRequest.Metadata().ID()))

okToDestroy, err := r.Teardown(ctx, block.NewMountStatus(block.NamespaceName, mountRequest.Metadata().ID()).Metadata())
okToDestroy, err := r.Teardown(ctx, block.NewMountStatus(mountRequest.Metadata().ID()).Metadata())
if err != nil {
if state.IsNotFoundError(err) {
// no mount status, we are done
Expand All @@ -277,7 +278,7 @@ func (ctrl *MountController) tearDownMountStatus(ctx context.Context, r controll
return false, nil
}

err = r.Destroy(ctx, block.NewMountStatus(block.NamespaceName, mountRequest.Metadata().ID()).Metadata())
err = r.Destroy(ctx, block.NewMountStatus(mountRequest.Metadata().ID()).Metadata())
if err != nil {
return false, fmt.Errorf("failed to destroy mount status %q: %w", mountRequest.Metadata().ID(), err)
}
Expand Down
7 changes: 4 additions & 3 deletions internal/app/machined/pkg/controllers/block/mount_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/cosi-project/runtime/pkg/state"
"go.uber.org/zap"

"github.com/siderolabs/talos/pkg/machinery/resources"
"github.com/siderolabs/talos/pkg/machinery/resources/block"
)

Expand All @@ -30,12 +31,12 @@ func (ctrl *MountStatusController) Name() string {
func (ctrl *MountStatusController) Inputs() []controller.Input {
return []controller.Input{
{
Namespace: block.NamespaceName,
Namespace: resources.InMemoryNamespace,
Type: block.MountStatusType,
Kind: controller.InputStrong,
},
{
Namespace: block.NamespaceName,
Namespace: resources.InMemoryNamespace,
Type: block.VolumeMountStatusType,
Kind: controller.InputDestroyReady,
},
Expand Down Expand Up @@ -83,7 +84,7 @@ func (ctrl *MountStatusController) Run(ctx context.Context, r controller.Runtime
requestID := mountStatus.TypedSpec().Spec.RequesterIDs[i]

if err = safe.WriterModify(
ctx, r, block.NewVolumeMountStatus(block.NamespaceName, requestID),
ctx, r, block.NewVolumeMountStatus(requestID),
func(vms *block.VolumeMountStatus) error {
vms.Metadata().Labels().Set("mount-status-id", mountStatus.Metadata().ID())
vms.TypedSpec().Requester = requester
Expand Down
12 changes: 6 additions & 6 deletions internal/app/machined/pkg/controllers/block/mount_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestMountStatusSuite(t *testing.T) {
}

func (suite *MountStatusSuite) TestReconcile() {
mountStatus1 := block.NewMountStatus(block.NamespaceName, "volume1")
mountStatus1 := block.NewMountStatus("volume1")
mountStatus1.TypedSpec().Spec = block.MountRequestSpec{
VolumeID: "volume1",
Requesters: []string{"requester1", "requester2"},
Expand All @@ -61,7 +61,7 @@ func (suite *MountStatusSuite) TestReconcile() {
})

// add a finalizer for volume mount status
suite.AddFinalizer(block.NewVolumeMountStatus(block.NamespaceName, "requester1/volume1").Metadata(), "test-finalizer")
suite.AddFinalizer(block.NewVolumeMountStatus("requester1/volume1").Metadata(), "test-finalizer")

// now, teardown the mount status
ready, err := suite.State().Teardown(suite.Ctx(), mountStatus1.Metadata())
Expand All @@ -77,7 +77,7 @@ func (suite *MountStatusSuite) TestReconcile() {
})

// remove finalizer from volume mount status
suite.RemoveFinalizer(block.NewVolumeMountStatus(block.NamespaceName, "requester1/volume1").Metadata(), "test-finalizer")
suite.RemoveFinalizer(block.NewVolumeMountStatus("requester1/volume1").Metadata(), "test-finalizer")

// volume mount status should be destroyed
ctest.AssertNoResource[*block.VolumeMountStatus](suite, "requester1/volume1")
Expand All @@ -91,7 +91,7 @@ func (suite *MountStatusSuite) TestReconcile() {
}

func (suite *MountStatusSuite) TestReconcileRequesterGoingOut() {
mountStatus1 := block.NewMountStatus(block.NamespaceName, "volume1")
mountStatus1 := block.NewMountStatus("volume1")
mountStatus1.TypedSpec().Spec = block.MountRequestSpec{
VolumeID: "volume1",
Requesters: []string{"requester1", "requester2"},
Expand All @@ -111,7 +111,7 @@ func (suite *MountStatusSuite) TestReconcileRequesterGoingOut() {
)

// put a finalizer on volume mount status
suite.AddFinalizer(block.NewVolumeMountStatus(block.NamespaceName, "requester1/volume1").Metadata(), "test-finalizer")
suite.AddFinalizer(block.NewVolumeMountStatus("requester1/volume1").Metadata(), "test-finalizer")

// update the mount status, as if requester1 is no longer mounting it
mountStatus1, err := safe.StateGetByID[*block.MountStatus](suite.Ctx(), suite.State(), mountStatus1.Metadata().ID())
Expand All @@ -127,7 +127,7 @@ func (suite *MountStatusSuite) TestReconcileRequesterGoingOut() {
})

// remove finalizer from volume mount status
suite.RemoveFinalizer(block.NewVolumeMountStatus(block.NamespaceName, "requester1/volume1").Metadata(), "test-finalizer")
suite.RemoveFinalizer(block.NewVolumeMountStatus("requester1/volume1").Metadata(), "test-finalizer")

// volume mount status should be destroyed
ctest.AssertNoResource[*block.VolumeMountStatus](suite, "requester1/volume1")
Expand Down
3 changes: 2 additions & 1 deletion internal/app/machined/pkg/controllers/block/swap_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"go.uber.org/zap"

machineruntime "github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
"github.com/siderolabs/talos/pkg/machinery/resources"
"github.com/siderolabs/talos/pkg/machinery/resources/block"
)

Expand All @@ -39,7 +40,7 @@ func (ctrl *SwapStatusController) Inputs() []controller.Input {
return []controller.Input{
{
// not really a dependency, but we refresh swap status on mount status change
Namespace: block.NamespaceName,
Namespace: resources.InMemoryNamespace,
Type: block.MountStatusType,
Kind: controller.InputWeak,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/siderolabs/talos/pkg/machinery/cel/celenv"
machineconfig "github.com/siderolabs/talos/pkg/machinery/config/config"
"github.com/siderolabs/talos/pkg/machinery/constants"
"github.com/siderolabs/talos/pkg/machinery/resources"
"github.com/siderolabs/talos/pkg/machinery/resources/block"
"github.com/siderolabs/talos/pkg/machinery/resources/config"
)
Expand Down Expand Up @@ -49,7 +50,7 @@ func (ctrl *UserDiskConfigController) Inputs() []controller.Input {
Kind: controller.InputDestroyReady,
},
{
Namespace: block.NamespaceName,
Namespace: resources.InMemoryNamespace,
Type: block.VolumeMountStatusType,
Kind: controller.InputStrong,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (suite *UserDiskConfigSuite) TestReconcileUserDisk() {

// now emulate that the mount requests are fulfilled
for _, id := range []string{disk1 + "-1", disk1 + "-2", disk2 + "-1"} {
volumeMountStatus := block.NewVolumeMountStatus(block.NamespaceName, id)
volumeMountStatus := block.NewVolumeMountStatus(id)
suite.Create(volumeMountStatus)

suite.AddFinalizer(block.NewVolumeMountRequest(block.NamespaceName, id).Metadata(), "test")
Expand All @@ -174,7 +174,7 @@ func (suite *UserDiskConfigSuite) TestReconcileUserDisk() {

// start tearing down volume mount status
for _, id := range []string{disk1 + "-1", disk1 + "-2", disk2 + "-1"} {
_, err := suite.State().Teardown(suite.Ctx(), block.NewVolumeMountStatus(block.NamespaceName, id).Metadata())
_, err := suite.State().Teardown(suite.Ctx(), block.NewVolumeMountStatus(id).Metadata())
suite.Require().NoError(err)
}

Expand Down
Loading
Loading