@@ -11,6 +11,7 @@ import (
11
11
"github.com/spf13/cobra"
12
12
flag "github.com/spf13/pflag"
13
13
"k8s.io/apimachinery/pkg/runtime"
14
+ "k8s.io/apimachinery/pkg/runtime/schema"
14
15
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
15
16
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
16
17
"k8s.io/client-go/tools/clientcmd/api"
@@ -48,8 +49,8 @@ func NewRunCommand(_ context.Context) *cobra.Command {
48
49
49
50
type runOptions struct {
50
51
PlatformCluster * clusters.Cluster
51
-
52
- Log logging.Logger
52
+ GVKList []schema. GroupVersionKind
53
+ Log logging.Logger
53
54
}
54
55
55
56
func (o * runOptions ) addFlags (fs * flag.FlagSet ) {
@@ -67,6 +68,7 @@ func (o *runOptions) complete() (err error) {
67
68
if err = o .setupPlatformClusterClient (); err != nil {
68
69
return err
69
70
}
71
+ o .setupGVKList ()
70
72
71
73
return nil
72
74
}
@@ -91,6 +93,13 @@ func (o *runOptions) setupPlatformClusterClient() error {
91
93
return nil
92
94
}
93
95
96
+ func (o * runOptions ) setupGVKList () {
97
+ o .GVKList = []schema.GroupVersionKind {
98
+ {Group : "openmcp.cloud" , Version : "v1alpha1" , Kind : "ClusterProvider" },
99
+ {Group : "openmcp.cloud" , Version : "v1alpha1" , Kind : "MCPServiceProvider" },
100
+ }
101
+ }
102
+
94
103
func (o * runOptions ) run () error {
95
104
o .Log .Info ("starting openmcp-operator" , "platform-cluster" , o .PlatformCluster .ConfigPath ())
96
105
@@ -110,7 +119,7 @@ func (o *runOptions) run() error {
110
119
if err = (& controller.DeployableReconciler {
111
120
PlatformClient : mgr .GetClient (),
112
121
Scheme : mgr .GetScheme (),
113
- }).SetupWithManager (mgr ); err != nil {
122
+ }).SetupWithManager (mgr , o . GVKList ); err != nil {
114
123
return fmt .Errorf ("unable to create controller: %w" , err )
115
124
}
116
125
0 commit comments