Skip to content

Commit 5e984b0

Browse files
Merge pull request #720 from deads2k/apply-08-produces-start
API-1835: adds `output-resources` to cluster-authentication operator.
2 parents eb16aee + 7a75a1d commit 5e984b0

File tree

17 files changed

+342
-46
lines changed

17 files changed

+342
-46
lines changed

cmd/authentication-operator/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ package main
33
import (
44
"os"
55

6+
"github.com/openshift/cluster-authentication-operator/pkg/cmd/mom"
7+
"github.com/openshift/cluster-authentication-operator/pkg/cmd/operator"
68
"github.com/spf13/cobra"
7-
89
"k8s.io/cli-runtime/pkg/genericiooptions"
910
"k8s.io/component-base/cli"
10-
11-
"github.com/openshift/cluster-authentication-operator/pkg/cmd/mom"
12-
"github.com/openshift/cluster-authentication-operator/pkg/cmd/operator"
1311
)
1412

1513
func main() {
@@ -34,6 +32,7 @@ func NewAuthenticationOperatorCommand() *cobra.Command {
3432

3533
cmd.AddCommand(operator.NewOperator())
3634
cmd.AddCommand(mom.NewApplyConfigurationCommand(ioStreams))
35+
cmd.AddCommand(mom.NewOutputResourcesCommand(ioStreams))
3736

3837
return cmd
3938
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ require (
99
github.com/openshift/api v0.0.0-20241001152557-e415140e5d5f
1010
github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660
1111
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f
12-
github.com/openshift/library-go v0.0.0-20241021151851-4c5ecb35c294
13-
github.com/openshift/multi-operator-manager v0.0.0-20241017140751-8b22f6c45da3
12+
github.com/openshift/library-go v0.0.0-20241023193830-022ad9c25e39
13+
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc
1414
github.com/spf13/cobra v1.8.1
1515
github.com/stretchr/testify v1.9.0
1616
go.etcd.io/etcd/client/v3 v3.5.14

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660 h1:F0
148148
github.com/openshift/build-machinery-go v0.0.0-20240613134303-8359781da660/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
149149
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f h1:FRc0bVNWprihWS0GqQWzb3dY4dkCwpOP3mDw5NwSoR4=
150150
github.com/openshift/client-go v0.0.0-20241001162912-da6d55e4611f/go.mod h1:KiZi2mJRH1TOJ3FtBDYS6YvUL30s/iIXaGSUrSa36mo=
151-
github.com/openshift/library-go v0.0.0-20241021151851-4c5ecb35c294 h1:wz02/A1CsKVqNJD+Yg4NLw9SnNpGX9JK5lEb4qxM81k=
152-
github.com/openshift/library-go v0.0.0-20241021151851-4c5ecb35c294/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
153-
github.com/openshift/multi-operator-manager v0.0.0-20241017140751-8b22f6c45da3 h1:/rOm5CjL8W8sSeSzf/bg8wySP98+juT2SbVhBhmROLo=
154-
github.com/openshift/multi-operator-manager v0.0.0-20241017140751-8b22f6c45da3/go.mod h1:7u7Wj5yctFzwixEJdrnpZCCNuJwdwls3SwqHoxRlN7E=
151+
github.com/openshift/library-go v0.0.0-20241023193830-022ad9c25e39 h1:QUoMgNRHKDX0BXCbsdYHwoIyqYBGSJy9dNBAph9WqEU=
152+
github.com/openshift/library-go v0.0.0-20241023193830-022ad9c25e39/go.mod h1:9B1MYPoLtP9tqjWxcbUNVpwxy68zOH/3EIP6c31dAM0=
153+
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc h1:DPatMo6iid7ruxVr3LEu0EHe3oll9CYZYO4A8vV3RYU=
154+
github.com/openshift/multi-operator-manager v0.0.0-20241022160113-b880eaae93fc/go.mod h1:7u7Wj5yctFzwixEJdrnpZCCNuJwdwls3SwqHoxRlN7E=
155155
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
156156
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
157157
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

pkg/cmd/mom/apply_configuration_command.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66

77
"github.com/openshift/cluster-authentication-operator/pkg/operator"
8-
98
"github.com/openshift/multi-operator-manager/pkg/library/libraryapplyconfiguration"
109
"github.com/spf13/cobra"
1110
"k8s.io/cli-runtime/pkg/genericiooptions"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package mom
2+
3+
import (
4+
"context"
5+
6+
"github.com/openshift/multi-operator-manager/pkg/library/libraryoutputresources"
7+
"github.com/spf13/cobra"
8+
"k8s.io/cli-runtime/pkg/genericiooptions"
9+
)
10+
11+
func NewOutputResourcesCommand(streams genericiooptions.IOStreams) *cobra.Command {
12+
return libraryoutputresources.NewOutputResourcesCommand(RunOutputResources, streams)
13+
}
14+
15+
func RunOutputResources(ctx context.Context) (*libraryoutputresources.OutputResources, error) {
16+
return &libraryoutputresources.OutputResources{
17+
ConfigurationResources: libraryoutputresources.ResourceList{
18+
ExactResources: []libraryoutputresources.ExactResource{
19+
exactResource("config.openshift.io", "ingresses", "", "cluster"),
20+
},
21+
},
22+
ManagementResources: libraryoutputresources.ResourceList{
23+
ExactResources: []libraryoutputresources.ExactResource{
24+
exactResource("config.openshift.io", "clusteroperators", "", "authentication"),
25+
exactResource("openshift.openshift.io", "authentications", "", "cluster"),
26+
},
27+
},
28+
UserWorkloadResources: libraryoutputresources.ResourceList{
29+
ExactResources: []libraryoutputresources.ExactResource{
30+
exactResource("", "secrets", "openshift-authentication", "v4-0-config-system-session"),
31+
exactResource("", "secrets", "openshift-authentication", "v4-0-config-system-ocp-branding-template"),
32+
exactResource("", "serviceaccounts", "openshift-authentication", "oauth-openshift"),
33+
exactResource("apps", "deployments", "openshift-authentication", "oauth-openshift"),
34+
exactResource("oauth.openshift.io", "oauthclients", "", "openshift-browser-client"),
35+
exactResource("oauth.openshift.io", "oauthclients", "", "openshift-challenging-client"),
36+
exactResource("oauth.openshift.io", "oauthclients", "", "openshift-cli-client"),
37+
exactResource("rbac.authorization.k8s.io", "clusterrolebindings", "", "system:openshift:openshift-authentication"),
38+
exactResource("rbac.authorization.k8s.io", "rolebindings", "openshift-config-managed", "system:openshift:oauth-servercert-trust"),
39+
exactResource("rbac.authorization.k8s.io", "roles", "openshift-config-managed", "system:openshift:oauth-servercert-trust"),
40+
},
41+
GeneratedNameResources: []libraryoutputresources.GeneratedNameResource{
42+
generatedResource("certificates.k8s.io", "certificatesigningrequests", "", "system:openshift:openshift-authenticator-"),
43+
},
44+
},
45+
}, nil
46+
}
47+
48+
func exactResource(group, resource, namespace, name string) libraryoutputresources.ExactResource {
49+
return libraryoutputresources.ExactResource{
50+
OutputResourceTypeIdentifier: libraryoutputresources.OutputResourceTypeIdentifier{
51+
Group: group,
52+
Resource: resource,
53+
},
54+
Namespace: namespace,
55+
Name: name,
56+
}
57+
}
58+
59+
func generatedResource(group, resource, namespace, name string) libraryoutputresources.GeneratedNameResource {
60+
return libraryoutputresources.GeneratedNameResource{
61+
OutputResourceTypeIdentifier: libraryoutputresources.OutputResourceTypeIdentifier{
62+
Group: group,
63+
Resource: resource,
64+
},
65+
Namespace: namespace,
66+
GeneratedName: name,
67+
}
68+
}

vendor/github.com/openshift/library-go/pkg/crypto/crypto.go

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

vendor/github.com/openshift/library-go/pkg/manifestclient/mutation_directory_reader.go

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

vendor/github.com/openshift/library-go/pkg/manifestclient/mutation_tracker.go

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

vendor/github.com/openshift/library-go/pkg/manifestclient/serialized_request.go

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

vendor/github.com/openshift/library-go/pkg/manifestclient/write_roundtripper.go

Lines changed: 1 addition & 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)