Skip to content

Commit f9722a2

Browse files
Merge pull request #730 from bertinatto/input-resources
API-1835: Add input-resources
2 parents 4e9ba65 + 5d898b2 commit f9722a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6629
-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

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ require (
3131

3232
require (
3333
github.com/NYTimes/gziphandler v1.1.1 // indirect
34+
github.com/PaesslerAG/gval v1.2.3 // indirect
35+
github.com/PaesslerAG/jsonpath v0.1.1 // indirect
3436
github.com/RangelReale/osincli v0.0.0-20160924135400-fababb0555f2 // indirect
3537
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
3638
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
@@ -77,6 +79,7 @@ require (
7779
github.com/prometheus/common v0.55.0 // indirect
7880
github.com/prometheus/procfs v0.15.1 // indirect
7981
github.com/robfig/cron v1.2.0 // indirect
82+
github.com/shopspring/decimal v1.3.1 // indirect
8083
github.com/sirupsen/logrus v1.9.3 // indirect
8184
github.com/spf13/pflag v1.0.5 // indirect
8285
github.com/stoewer/go-strcase v1.2.0 // indirect

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
22
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
3+
github.com/PaesslerAG/gval v1.0.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I=
4+
github.com/PaesslerAG/gval v1.2.3 h1:Z3B/zLyWvqxjUtkIOEkFauqLnQn8Q37F1Q+uAjLXgMw=
5+
github.com/PaesslerAG/gval v1.2.3/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac=
6+
github.com/PaesslerAG/jsonpath v0.1.0/go.mod h1:4BzmtoM/PI8fPO4aQGIusjGxGir2BzcV0grWtFzq1Y8=
7+
github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk=
8+
github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY=
39
github.com/RangelReale/osincli v0.0.0-20160924135400-fababb0555f2 h1:x8Brv0YNEe6jY3V/hQglIG2nd8g5E2Zj5ubGKkPQctQ=
410
github.com/RangelReale/osincli v0.0.0-20160924135400-fababb0555f2/go.mod h1:XyjUkMA8GN+tOOPXvnbi3XuRxWFvTJntqvTFnjmhzbk=
511
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
@@ -175,6 +181,8 @@ github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfm
175181
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
176182
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
177183
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
184+
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
185+
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
178186
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
179187
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
180188
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
}

vendor/github.com/PaesslerAG/gval/.gitignore

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/PaesslerAG/gval/.travis.yml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/PaesslerAG/gval/LICENSE

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)