Moved all custom naming into one place

This commit is contained in:
2026-04-03 01:48:07 +08:00
parent 3c0df319d7
commit 1ce15e9ac5
27 changed files with 87 additions and 103 deletions

View File

@@ -11,10 +11,10 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/klog/v2"
types "undecided.project/monok8s/pkg/apis/monok8s/v1alpha1"
mkscmd "undecided.project/monok8s/pkg/cmd"
"undecided.project/monok8s/pkg/kube"
"undecided.project/monok8s/pkg/templates"
monov1alpha1 "example.com/monok8s/pkg/apis/monok8s/v1alpha1"
mkscmd "example.com/monok8s/pkg/cmd"
"example.com/monok8s/pkg/kube"
"example.com/monok8s/pkg/templates"
)
func NewCmdAgent(flags *genericclioptions.ConfigFlags) *cobra.Command {
@@ -26,7 +26,7 @@ func NewCmdAgent(flags *genericclioptions.ConfigFlags) *cobra.Command {
Short: "Watch OSUpgrade resources and do nothing for now",
RunE: func(cmd *cobra.Command, _ []string) error {
var cfg *types.MonoKSConfig // or value, depending on your API
var cfg *monov1alpha1.MonoKSConfig // or value, depending on your API
if err := mkscmd.LoadEnvFile(envFile); err != nil {
return fmt.Errorf("load env file %q: %w", envFile, err)
@@ -41,7 +41,7 @@ func NewCmdAgent(flags *genericclioptions.ConfigFlags) *cobra.Command {
if err != nil {
return err
}
gvr := schema.GroupVersionResource{Group: types.Group, Version: types.Version, Resource: "osupgrades"}
gvr := schema.GroupVersionResource{Group: monov1alpha1.Group, Version: monov1alpha1.Version, Resource: "osupgrades"}
ctx := cmd.Context()
for {
list, err := clients.Dynamic.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{})