Ability to pre-pull VM images by targeting workers with labels

This commit is contained in:
Nikolay Edigaryev
2025-12-10 20:43:34 +01:00
parent 173a34b083
commit aa36ad4cb6
29 changed files with 1463 additions and 8 deletions
+7 -1
View File
@@ -10,7 +10,13 @@ func NewCommand() *cobra.Command {
Short: "Delete resources from the controller",
}
command.AddCommand(newDeleteVMCommand(), newDeleteServiceComandCommand(), newDeleteWorkerCommand())
command.AddCommand(
newDeleteVMCommand(),
newDeleteServiceComandCommand(),
newDeleteWorkerCommand(),
newDeleteImagePullCommand(),
newDeleteImagePullJobCommand(),
)
return command
}
+26
View File
@@ -0,0 +1,26 @@
package deletecmd
import (
"github.com/cirruslabs/orchard/pkg/client"
"github.com/spf13/cobra"
)
func newDeleteImagePullCommand() *cobra.Command {
return &cobra.Command{
Use: "imagepull NAME",
Short: "Delete an image pull",
Args: cobra.ExactArgs(1),
RunE: runDeleteImagePull,
}
}
func runDeleteImagePull(cmd *cobra.Command, args []string) error {
name := args[0]
client, err := client.New()
if err != nil {
return err
}
return client.ImagePulls().Delete(cmd.Context(), name)
}
@@ -0,0 +1,26 @@
package deletecmd
import (
"github.com/cirruslabs/orchard/pkg/client"
"github.com/spf13/cobra"
)
func newDeleteImagePullJobCommand() *cobra.Command {
return &cobra.Command{
Use: "imagepulljob NAME",
Short: "Delete an image pull job",
Args: cobra.ExactArgs(1),
RunE: runDeleteImagePullJob,
}
}
func runDeleteImagePullJob(cmd *cobra.Command, args []string) error {
name := args[0]
client, err := client.New()
if err != nil {
return err
}
return client.ImagePullJobs().Delete(cmd.Context(), name)
}