@@ -13,6 +13,7 @@ import (
1313 "github.com/UpCloudLtd/progress/messages"
1414 "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands"
1515 "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands/database"
16+ "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands/filestorage"
1617 "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands/kubernetes"
1718 "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands/loadbalancer"
1819 "github.com/UpCloudLtd/upcloud-cli/v3/internal/commands/network"
@@ -31,6 +32,7 @@ const (
3132 includeHelp = "Include resources matching the given name. If defined multiple times, resource is included if it matches any of the given names. `*` matches all resources."
3233 excludeHelp = "Exclude resources matching the given name. If defined multiple times, resource is included if it matches any of the given names."
3334
35+ typeFileStorage = "file-storage"
3436 typeKubernetes = "kubernetes-cluster"
3537 typeLoadBalancer = "load-balancer"
3638 typeCertificateBundle = "certificate-bundle"
@@ -147,7 +149,7 @@ func findResources[T any](exec commands.Executor, wg *sync.WaitGroup, returnChan
147149
148150func ListResources (exec commands.Executor , include , exclude []string ) ([]Resource , error ) {
149151 var resources []Resource
150- returnChan := make (chan findResult , 12 )
152+ returnChan := make (chan findResult , 13 )
151153
152154 var wg sync.WaitGroup
153155
@@ -163,7 +165,7 @@ func ListResources(exec commands.Executor, include, exclude []string) ([]Resourc
163165 findResources (exec , & wg , returnChan , & resolver.CachingStorage {Access : "private" }, include , exclude )
164166 findResources (exec , & wg , returnChan , & cachingTag {}, include , exclude )
165167 findResources (exec , & wg , returnChan , & cachingCertificateBundle {}, include , exclude )
166-
168+ findResources ( exec , & wg , returnChan , & resolver. CachingFileStorage {}, include , exclude )
167169 wg .Wait ()
168170 close (returnChan )
169171
@@ -187,6 +189,12 @@ func ListResources(exec commands.Executor, include, exclude []string) ([]Resourc
187189
188190func getResource (val any ) (Resource , error ) {
189191 switch v := val .(type ) {
192+ case upcloud.FileStorage :
193+ return Resource {
194+ Name : v .Name ,
195+ Type : typeFileStorage ,
196+ UUID : v .UUID ,
197+ }, nil
190198 case upcloud.LoadBalancer :
191199 return Resource {
192200 Name : v .Name ,
@@ -265,6 +273,8 @@ func getResource(val any) (Resource, error) {
265273
266274func deleteResource (exec commands.Executor , resource Resource ) (err error ) {
267275 switch resource .Type {
276+ case typeFileStorage :
277+ _ , err = filestorage .Delete (exec , resource .UUID , true )
268278 case typeKubernetes :
269279 _ , err = kubernetes .Delete (exec , resource .UUID , true )
270280 case typeLoadBalancer :
0 commit comments