mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
Refactor version/feature/cmd packages (#148)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/hub"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -13,8 +14,7 @@ import (
|
||||
utilflag "k8s.io/component-base/cli/flag"
|
||||
"k8s.io/component-base/logs"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/placement/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/placement/version"
|
||||
"open-cluster-management.io/ocm/pkg/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -49,7 +49,7 @@ func newPlacementCommand() *cobra.Command {
|
||||
cmd.Version = v
|
||||
}
|
||||
|
||||
cmd.AddCommand(hub.NewController())
|
||||
cmd.AddCommand(hub.NewPlacementController())
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/spoke"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -13,8 +15,7 @@ import (
|
||||
utilflag "k8s.io/component-base/cli/flag"
|
||||
"k8s.io/component-base/logs"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/registration-operator/cmd/operator"
|
||||
"open-cluster-management.io/ocm/pkg/registration-operator/version"
|
||||
"open-cluster-management.io/ocm/pkg/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -50,8 +51,8 @@ func newNucleusCommand() *cobra.Command {
|
||||
cmd.Version = v
|
||||
}
|
||||
|
||||
cmd.AddCommand(operator.NewHubOperatorCmd())
|
||||
cmd.AddCommand(operator.NewKlusterletOperatorCmd())
|
||||
cmd.AddCommand(hub.NewHubOperatorCmd())
|
||||
cmd.AddCommand(spoke.NewKlusterletOperatorCmd())
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/spoke"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -13,10 +15,8 @@ import (
|
||||
utilflag "k8s.io/component-base/cli/flag"
|
||||
"k8s.io/component-base/logs"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/registration/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/registration/cmd/spoke"
|
||||
"open-cluster-management.io/ocm/pkg/registration/cmd/webhook"
|
||||
"open-cluster-management.io/ocm/pkg/registration/version"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/webhook"
|
||||
"open-cluster-management.io/ocm/pkg/version"
|
||||
)
|
||||
|
||||
// The registration binary contains both the hub-side controllers for the
|
||||
@@ -57,8 +57,8 @@ func newRegistrationCommand() *cobra.Command {
|
||||
cmd.Version = v
|
||||
}
|
||||
|
||||
cmd.AddCommand(hub.NewController())
|
||||
cmd.AddCommand(spoke.NewAgent())
|
||||
cmd.AddCommand(webhook.NewWebhook())
|
||||
cmd.AddCommand(hub.NewRegistrationController())
|
||||
cmd.AddCommand(spoke.NewRegistrationAgent())
|
||||
cmd.AddCommand(webhook.NewRegistrationWebhook())
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/spoke"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -13,10 +15,8 @@ import (
|
||||
utilflag "k8s.io/component-base/cli/flag"
|
||||
"k8s.io/component-base/logs"
|
||||
|
||||
"open-cluster-management.io/ocm/pkg/work/cmd/hub"
|
||||
"open-cluster-management.io/ocm/pkg/work/cmd/spoke"
|
||||
"open-cluster-management.io/ocm/pkg/work/cmd/webhook"
|
||||
"open-cluster-management.io/ocm/pkg/work/version"
|
||||
"open-cluster-management.io/ocm/pkg/cmd/webhook"
|
||||
"open-cluster-management.io/ocm/pkg/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -52,8 +52,8 @@ func newWorkCommand() *cobra.Command {
|
||||
cmd.Version = v
|
||||
}
|
||||
|
||||
cmd.AddCommand(spoke.NewWorkloadAgent())
|
||||
cmd.AddCommand(webhook.NewWebhook())
|
||||
cmd.AddCommand(hub.NewHubManager())
|
||||
cmd.AddCommand(spoke.NewWorkAgent())
|
||||
cmd.AddCommand(webhook.NewWorkWebhook())
|
||||
cmd.AddCommand(hub.NewWorkController())
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user