Skip to content

Commit 2c214ae

Browse files
committed
Add OM apply-configuration command stub
Create apply-configuration command with comprehensive documentation stub. This command requires integration with operator core logic to run reconciliation using the manifestclient. The stub provides: - Clear usage documentation - Implementation requirements and steps - Reference to cluster-authentication-operator implementation - Key considerations for manifestclient integration Note: Full implementation requires refactoring operator sync logic to work with manifestclient instead of live API server. Generated with Claude Code
1 parent 6c4785d commit 2c214ae

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func NewSSCSCommand(ctx context.Context) *cobra.Command {
4848
cmd.AddCommand(recoverycontroller.NewCertRecoveryControllerCommand(ctx))
4949
cmd.AddCommand(mom.NewInputResourcesCommand(ioStreams))
5050
cmd.AddCommand(mom.NewOutputResourcesCommand(ioStreams))
51+
cmd.AddCommand(mom.NewApplyConfigurationCommand(ioStreams))
5152

5253
return cmd
5354
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package mom
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
"k8s.io/cli-runtime/pkg/genericiooptions"
8+
)
9+
10+
func NewApplyConfigurationCommand(streams genericiooptions.IOStreams) *cobra.Command {
11+
cmd := &cobra.Command{
12+
Use: "apply-configuration",
13+
Short: "Run operator reconciliation logic using manifestclient (not yet implemented)",
14+
Long: `Run the operator's reconciliation logic once using the manifestclient.
15+
16+
This command is not yet implemented. Implementation requires:
17+
18+
1. Create operator client using manifestclient interfaces
19+
2. Create necessary informers using manifestclient
20+
3. Initialize the operator's controllers (targetconfigcontroller, etc.)
21+
4. Run sync logic ONCE (not in a loop)
22+
5. Return results
23+
24+
The manifestclient is a drop-in replacement for standard Kubernetes clients
25+
that reads from files instead of the API server, enabling testing without a cluster.
26+
27+
Reference implementation:
28+
github.com/openshift/cluster-authentication-operator/pkg/cmd/mom/apply_configuration_command.go
29+
30+
Key considerations:
31+
- Use manifestclient instead of regular kubeClient
32+
- Use manifestclient event recorder for events
33+
- Call sync functions directly, don't start controllers/informers
34+
- The operator needs to produce all output resources declared in output-resources
35+
`,
36+
RunE: func(cmd *cobra.Command, args []string) error {
37+
return fmt.Errorf("apply-configuration command is not yet implemented - requires integration with operator core logic")
38+
},
39+
}
40+
41+
return cmd
42+
}

0 commit comments

Comments
 (0)