Skip to content

Commit 026d756

Browse files
committed
Add OM input-resources command stub
Generated with Claude Code
1 parent b7179d1 commit 026d756

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

cmd/cluster-kube-controller-manager-operator/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/spf13/cobra"
88

9+
"k8s.io/cli-runtime/pkg/genericiooptions"
910
"k8s.io/component-base/cli"
1011

1112
"github.com/openshift/library-go/pkg/operator/staticpod/certsyncpod"
@@ -16,6 +17,7 @@ import (
1617
"github.com/openshift/cluster-kube-controller-manager-operator/pkg/cmd/recoverycontroller"
1718
"github.com/openshift/cluster-kube-controller-manager-operator/pkg/cmd/render"
1819
"github.com/openshift/cluster-kube-controller-manager-operator/pkg/cmd/resourcegraph"
20+
"github.com/openshift/cluster-kube-controller-manager-operator/pkg/cmd/mom"
1921
"github.com/openshift/cluster-kube-controller-manager-operator/pkg/operator"
2022
)
2123

@@ -35,13 +37,16 @@ func NewSSCSCommand(ctx context.Context) *cobra.Command {
3537
},
3638
}
3739

40+
ioStreams := genericiooptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}
41+
3842
cmd.AddCommand(operatorcmd.NewOperator())
3943
cmd.AddCommand(render.NewRenderCommand(nil))
4044
cmd.AddCommand(installerpod.NewInstaller(ctx))
4145
cmd.AddCommand(prune.NewPrune())
4246
cmd.AddCommand(resourcegraph.NewResourceChainCommand())
4347
cmd.AddCommand(certsyncpod.NewCertSyncControllerCommand(operator.CertConfigMaps, operator.CertSecrets))
4448
cmd.AddCommand(recoverycontroller.NewCertRecoveryControllerCommand(ctx))
49+
cmd.AddCommand(mom.NewInputResourcesCommand(ioStreams))
4550

4651
return cmd
4752
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package mom
2+
3+
import (
4+
"context"
5+
6+
"github.com/openshift/multi-operator-manager/pkg/library/libraryinputresources"
7+
"github.com/openshift/multi-operator-manager/pkg/library/libraryoutputresources"
8+
"github.com/spf13/cobra"
9+
"k8s.io/cli-runtime/pkg/genericiooptions"
10+
)
11+
12+
func NewInputResourcesCommand(streams genericiooptions.IOStreams) *cobra.Command {
13+
return libraryinputresources.NewInputResourcesCommand(runInputResources, runOutputResources, streams)
14+
}
15+
16+
func runInputResources(ctx context.Context) (*libraryinputresources.InputResources, error) {
17+
return &libraryinputresources.InputResources{
18+
ApplyConfigurationResources: libraryinputresources.ResourceList{
19+
ExactResources: []libraryinputresources.ExactResourceID{
20+
// TODO: Fill in discovered resources
21+
},
22+
},
23+
}, nil
24+
}
25+
26+
// runOutputResources is defined here to support the input-resources command
27+
// The actual implementation will be in output_resources_command.go
28+
func runOutputResources(ctx context.Context) (*libraryoutputresources.OutputResources, error) {
29+
return &libraryoutputresources.OutputResources{
30+
ConfigurationResources: libraryoutputresources.ResourceList{
31+
ExactResources: []libraryoutputresources.ExactResourceID{},
32+
},
33+
ManagementResources: libraryoutputresources.ResourceList{
34+
ExactResources: []libraryoutputresources.ExactResourceID{},
35+
},
36+
UserWorkloadResources: libraryoutputresources.ResourceList{
37+
ExactResources: []libraryoutputresources.ExactResourceID{},
38+
},
39+
}, nil
40+
}

0 commit comments

Comments
 (0)