Skip to content

Commit

Permalink
fix: role needs permissions to deployment list
Browse files Browse the repository at this point in the history
  • Loading branch information
santinoncs committed Nov 23, 2020
1 parent ed48e1a commit a187b25
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
9 changes: 0 additions & 9 deletions api/v1alpha1/ratelimit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ type Rate struct {
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// RateLimitSpec defines the desired state of RateLimit
/*type RateLimitSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
TargetRef v1.ObjectReference `json:"targetRef"`
Dimensions DimensionsList `json:"dimensions"`
WorkloadSelector map[string]string `json:"workloadselector"`
}
*/
type RateLimitSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Expand Down
6 changes: 0 additions & 6 deletions config/crd/bases/networking.softonic.io_ratelimits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ spec:
metadata:
type: object
spec:
description: "RateLimitSpec defines the desired state of RateLimit type
RateLimitSpec struct { \t// INSERT ADDITIONAL SPEC FIELDS - desired
state of cluster \t// Important: Run \"make\" to regenerate code after
modifying this file \tTargetRef v1.ObjectReference `json:\"targetRef\"`
\tDimensions DimensionsList `json:\"dimensions\"` \tWorkloadSelector
map[string]string `json:\"workloadselector\"` }"
properties:
destinationCluster:
type: string
Expand Down
12 changes: 12 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
Expand Down
3 changes: 1 addition & 2 deletions controllers/envoyfilterobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ type EnvoyFilterObject struct {

func (r *RateLimitReconciler) prepareUpdateEnvoyFilterObjects(rateLimitInstance networkingv1alpha1.RateLimit, baseName string, controllerNamespace string) error {

// controllerNamespace := os.Getenv("ISTIO_NAMESPACE")


istioNamespace := os.Getenv("ISTIO_NAMESPACE")


jsonActions := retrieveJsonActions(rateLimitInstance, baseName)

namespace := rateLimitInstance.Spec.TargetRef.Namespace
Expand Down
1 change: 1 addition & 0 deletions controllers/ratelimit_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type K8sObject struct {
// +kubebuilder:rbac:groups=batch,resources=envoyfilters/status,verbs=get
// +kubebuilder:rbac:groups=*,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete

func (r *RateLimitReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
_ = context.Background()
Expand Down

0 comments on commit a187b25

Please sign in to comment.