Some basic agent startup
This commit is contained in:
@@ -5,19 +5,19 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
monov1alpha1 "undecided.project/monok8s/pkg/apis/monok8s/v1alpha1"
|
||||
"undecided.project/monok8s/pkg/kube"
|
||||
"github.com/spf13/cobra"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/klog/v2"
|
||||
monov1alpha1 "undecided.project/monok8s/pkg/apis/monok8s/v1alpha1"
|
||||
"undecided.project/monok8s/pkg/kube"
|
||||
)
|
||||
|
||||
func NewCmdAgent(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
||||
var namespace string
|
||||
cmd := &cobra.Command{
|
||||
Use: "agent",
|
||||
Use: "agent --env-file path",
|
||||
Short: "Watch OSUpgrade resources and do nothing for now",
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
clients, err := kube.NewClients(flags)
|
||||
|
||||
@@ -81,6 +81,7 @@ Supported formats:
|
||||
rendered := templates.DefaultMonoKSConfig(vals)
|
||||
cfg = &rendered
|
||||
|
||||
klog.InfoS("starting init", "node", cfg.Spec.NodeName, "envFile", envFile)
|
||||
default:
|
||||
path, err := (config.Loader{}).ResolvePath(configPath)
|
||||
if err != nil {
|
||||
@@ -92,7 +93,7 @@ Supported formats:
|
||||
return err
|
||||
}
|
||||
cfg = loaded
|
||||
klog.InfoS("starting init", "config", path, "node", cfg.Spec.NodeName, "envFile", envFile)
|
||||
klog.InfoS("starting init", "node", cfg.Spec.NodeName, "config", path)
|
||||
}
|
||||
|
||||
runner := bootstrap.NewRunner(cfg)
|
||||
|
||||
Reference in New Issue
Block a user