Skip to content

Commit 602ffde

Browse files
committed
Add initial input-resources command
1 parent 4e9ba65 commit 602ffde

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

cmd/authentication-operator/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func NewAuthenticationOperatorCommand() *cobra.Command {
3232

3333
cmd.AddCommand(operator.NewOperator())
3434
cmd.AddCommand(mom.NewApplyConfigurationCommand(ioStreams))
35+
cmd.AddCommand(mom.NewInputResourcesCommand(ioStreams))
3536
cmd.AddCommand(mom.NewOutputResourcesCommand(ioStreams))
3637

3738
return cmd
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package mom
2+
3+
import (
4+
"context"
5+
6+
"github.com/openshift/multi-operator-manager/pkg/library/libraryinputresources"
7+
"github.com/spf13/cobra"
8+
"k8s.io/cli-runtime/pkg/genericiooptions"
9+
)
10+
11+
func NewInputResourcesCommand(streams genericiooptions.IOStreams) *cobra.Command {
12+
return libraryinputresources.NewInputResourcesCommand(runInputResources, streams)
13+
}
14+
15+
func runInputResources(ctx context.Context) (*libraryinputresources.InputResources, error) {
16+
return &libraryinputresources.InputResources{
17+
ApplyConfigurationResources: libraryinputresources.ResourceList{
18+
ExactResources: []libraryinputresources.ExactResourceID{
19+
// Operator
20+
libraryinputresources.ExactLowLevelOperator("authentications"),
21+
// Config
22+
libraryinputresources.ExactConfigResource("apiservers"),
23+
libraryinputresources.ExactConfigResource("infrastructures"),
24+
libraryinputresources.ExactConfigResource("oauths"),
25+
libraryinputresources.ExactConfigResource("ingresses"),
26+
libraryinputresources.ExactConfigResource("consoles"),
27+
libraryinputresources.ExactConfigResource("proxies"),
28+
libraryinputresources.ExactResource("config.openshift.io", "v1", "clusterversions", "", "version"),
29+
// OpenShift
30+
libraryinputresources.ExactResource("route.openshift.io", "v1", "routes", "openshift-authentication", "oauth-openshift"),
31+
// Core
32+
libraryinputresources.ExactResource("", "v1", "endpoints", "openshift-authentication", "oauth-openshift"),
33+
libraryinputresources.ExactResource("", "v1", "endpoints", "default", "kubernetes"),
34+
libraryinputresources.ExactResource("", "v1", "services", "default", "kubernetes"),
35+
libraryinputresources.ExactResource("", "v1", "services", "openshift-authentication", "oauth-openshift"),
36+
// Configuration
37+
libraryinputresources.ExactConfigMap("openshift-config-managed", "oauth-openshift"),
38+
libraryinputresources.ExactConfigMap("openshift-config-managed", "router-certs"),
39+
libraryinputresources.ExactConfigMap("openshift-config-managed", "default-ingress-cert"),
40+
// Operator
41+
libraryinputresources.ExactConfigMap("openshift-authentication-operator", "trusted-ca-bundle"),
42+
// Operand
43+
libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-metadata"),
44+
libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-service-ca"),
45+
libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-serving-cert"),
46+
libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-session"),
47+
libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-router-certs"),
48+
libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-custom-router-certs"),
49+
libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-ocp-branding-template"),
50+
// oauth-apiserver
51+
libraryinputresources.ExactClusterRole("system:openshift:useroauthaccesstoken-manager"),
52+
libraryinputresources.ExactClusterRoleBinding("system:openshift:useroauthaccesstoken-manager"),
53+
libraryinputresources.ExactClusterRoleBinding("system:openshift:oauth-apiserver"),
54+
libraryinputresources.ExactDeployment("openshift-oauth-apiserver", "openshift-oauth-apiserver"),
55+
libraryinputresources.ExactNamespace("openshift-oauth-apiserver"),
56+
libraryinputresources.ExactResource("policy", "v1", "poddisruptionbudgets", "openshift-oauth-apiserver", "oauth-apiserver-pdb"),
57+
libraryinputresources.ExactServiceAccount("openshift-oauth-apiserver", "oauth-apiserver-sa"),
58+
libraryinputresources.ExactResource("", "v1", "services", "openshift-oauth-apiserver", "api"),
59+
// oauth-openshift
60+
libraryinputresources.ExactConfigMap("openshift-authentication", "audit"),
61+
libraryinputresources.ExactClusterRoleBinding("system:openshift:openshift-authentication"),
62+
libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-trusted-ca-bundle"),
63+
libraryinputresources.ExactDeployment("openshift-authentication", "oauth-openshift"),
64+
libraryinputresources.ExactNamespace("openshift-authentication"),
65+
libraryinputresources.ExactResource("", "v1", "services", "openshift-authentication", "oauth-openshift"),
66+
libraryinputresources.ExactResource("route.openshift.io", "v1", "routes", "openshift-authentication", "oauth-openshift"),
67+
libraryinputresources.ExactServiceAccount("openshift-authentication", "oauth-openshift"),
68+
libraryinputresources.ExactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
69+
libraryinputresources.ExactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"),
70+
},
71+
},
72+
}, nil
73+
}

0 commit comments

Comments
 (0)