|
| 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 | + libraryinputresources.ExactConfigMap("openshift-authentication-operator", "trusted-ca-bundle"), |
| 22 | + // config.openshift.io |
| 23 | + libraryinputresources.ExactConfigResource("apiservers"), |
| 24 | + libraryinputresources.ExactConfigResource("infrastructures"), |
| 25 | + libraryinputresources.ExactConfigResource("oauths"), |
| 26 | + libraryinputresources.ExactConfigResource("ingresses"), |
| 27 | + libraryinputresources.ExactConfigResource("consoles"), |
| 28 | + libraryinputresources.ExactConfigResource("proxies"), |
| 29 | + libraryinputresources.ExactResource("config.openshift.io", "v1", "clusterversions", "", "version"), |
| 30 | + // Core |
| 31 | + libraryinputresources.ExactResource("", "v1", "endpoints", "openshift-authentication", "oauth-openshift"), |
| 32 | + libraryinputresources.ExactResource("", "v1", "endpoints", "default", "kubernetes"), |
| 33 | + libraryinputresources.ExactResource("", "v1", "services", "default", "kubernetes"), |
| 34 | + // Configuration |
| 35 | + libraryinputresources.ExactConfigMap("openshift-config-managed", "oauth-openshift"), |
| 36 | + libraryinputresources.ExactConfigMap("openshift-config-managed", "router-certs"), |
| 37 | + libraryinputresources.ExactConfigMap("openshift-config-managed", "default-ingress-cert"), |
| 38 | + // Operand |
| 39 | + libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-metadata"), |
| 40 | + libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-service-ca"), |
| 41 | + libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-serving-cert"), |
| 42 | + libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-session"), |
| 43 | + libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-router-certs"), |
| 44 | + libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-custom-router-certs"), |
| 45 | + libraryinputresources.ExactSecret("openshift-authentication", "v4-0-config-system-ocp-branding-template"), |
| 46 | + // oauth-apiserver |
| 47 | + libraryinputresources.ExactClusterRole("system:openshift:useroauthaccesstoken-manager"), |
| 48 | + libraryinputresources.ExactClusterRoleBinding("system:openshift:useroauthaccesstoken-manager"), |
| 49 | + libraryinputresources.ExactClusterRoleBinding("system:openshift:oauth-apiserver"), |
| 50 | + libraryinputresources.ExactDeployment("openshift-oauth-apiserver", "openshift-oauth-apiserver"), |
| 51 | + libraryinputresources.ExactNamespace("openshift-oauth-apiserver"), |
| 52 | + libraryinputresources.ExactResource("policy", "v1", "poddisruptionbudgets", "openshift-oauth-apiserver", "oauth-apiserver-pdb"), |
| 53 | + libraryinputresources.ExactServiceAccount("openshift-oauth-apiserver", "oauth-apiserver-sa"), |
| 54 | + libraryinputresources.ExactResource("", "v1", "services", "openshift-oauth-apiserver", "api"), |
| 55 | + // oauth-openshift |
| 56 | + libraryinputresources.ExactConfigMap("openshift-authentication", "audit"), |
| 57 | + libraryinputresources.ExactClusterRoleBinding("system:openshift:openshift-authentication"), |
| 58 | + libraryinputresources.ExactConfigMap("openshift-authentication", "v4-0-config-system-trusted-ca-bundle"), |
| 59 | + libraryinputresources.ExactDeployment("openshift-authentication", "oauth-openshift"), |
| 60 | + libraryinputresources.ExactNamespace("openshift-authentication"), |
| 61 | + libraryinputresources.ExactResource("", "v1", "services", "openshift-authentication", "oauth-openshift"), |
| 62 | + libraryinputresources.ExactResource("route.openshift.io", "v1", "routes", "openshift-authentication", "oauth-openshift"), |
| 63 | + libraryinputresources.ExactServiceAccount("openshift-authentication", "oauth-openshift"), |
| 64 | + libraryinputresources.ExactRoleBinding("openshift-config-managed", "system:openshift:oauth-servercert-trust"), |
| 65 | + libraryinputresources.ExactRole("openshift-config-managed", "system:openshift:oauth-servercert-trust"), |
| 66 | + }, |
| 67 | + }, |
| 68 | + }, nil |
| 69 | +} |
0 commit comments