Skip to content

Commit d4a44c0

Browse files
committed
refactoring (and more changes in the copied kubernetes code)
1 parent 49d899e commit d4a44c0

24 files changed

+433
-416
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole,
136136
.PHONY: generate
137137
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
138138
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
139-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./catalogd/api/..."
140139

141140
.PHONY: verify
142141
verify: tidy fmt generate manifests crd-ref-docs #HELP Verify all generated code is up-to-date.

api/v1/clusterextension_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1
1818

1919
import (
20+
rbacv1 "k8s.io/api/rbac/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -454,6 +455,8 @@ type ClusterExtensionStatus struct {
454455
//
455456
// +optional
456457
Install *ClusterExtensionInstallStatus `json:"install,omitempty"`
458+
459+
MissingRules map[string][]rbacv1.PolicyRule `json:"missingRules,omitempty"`
457460
}
458461

459462
// ClusterExtensionInstallStatus is a representation of the status of the identified bundle.

cmd/operator-controller/main.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ func run() error {
415415
helmApplier := &applier.Helm{
416416
ActionClientGetter: acg,
417417
Preflights: preflights,
418-
Authorizer: authorization.NewRBACAuthorizer(mgr.GetClient()),
419-
RuleResolver: authorization.NewRBACRulesResolver(mgr.GetClient()),
420-
RestMapper: mgr.GetRESTMapper(),
418+
PreAuthorizer: authorization.NewRBACPreAuthorizer(mgr.GetClient()),
421419
}
422420

423421
cm := contentmanager.NewManager(clientRestConfigMapper, mgr.GetConfig(), mgr.GetRESTMapper())

config/base/operator-controller/crd/bases/olm.operatorframework.io_clusterextensions.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,58 @@ spec:
581581
required:
582582
- bundle
583583
type: object
584+
missingRules:
585+
additionalProperties:
586+
items:
587+
description: |-
588+
PolicyRule holds information that describes a policy rule, but does not contain information
589+
about who the rule applies to or which namespace the rule applies to.
590+
properties:
591+
apiGroups:
592+
description: |-
593+
APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
594+
the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups.
595+
items:
596+
type: string
597+
type: array
598+
x-kubernetes-list-type: atomic
599+
nonResourceURLs:
600+
description: |-
601+
NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path
602+
Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding.
603+
Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.
604+
items:
605+
type: string
606+
type: array
607+
x-kubernetes-list-type: atomic
608+
resourceNames:
609+
description: ResourceNames is an optional white list of names
610+
that the rule applies to. An empty set means that everything
611+
is allowed.
612+
items:
613+
type: string
614+
type: array
615+
x-kubernetes-list-type: atomic
616+
resources:
617+
description: Resources is a list of resources this rule applies
618+
to. '*' represents all resources.
619+
items:
620+
type: string
621+
type: array
622+
x-kubernetes-list-type: atomic
623+
verbs:
624+
description: Verbs is a list of Verbs that apply to ALL the
625+
ResourceKinds contained in this rule. '*' represents all
626+
verbs.
627+
items:
628+
type: string
629+
type: array
630+
x-kubernetes-list-type: atomic
631+
required:
632+
- verbs
633+
type: object
634+
type: array
635+
type: object
584636
type: object
585637
type: object
586638
served: true

config/samples/crb.yaml

-1
This file was deleted.

config/samples/crb2.yaml

-24
This file was deleted.

config/samples/olm_v1_clusterextension.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ apiVersion: olm.operatorframework.io/v1
276276
kind: ClusterExtension
277277
metadata:
278278
name: argocd
279-
annotations:
280-
rev: "1"
281279
spec:
282280
namespace: argocd
283281
serviceAccount:

config/samples/xx_olm_v1_clusterextension.yaml

-103
This file was deleted.

0 commit comments

Comments
 (0)