Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issues #173 and #174 #175

Merged
merged 9 commits into from
Sep 3, 2019
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "2"
domain: microsoft.com
repo: github.com/Azure/azure-service-operator
resources:
- group: service
- group: azure
version: v1
kind: Storage
- group: service
- group: azure
version: v1
kind: CosmosDB
- group: service
- group: azure
version: v1
kind: RedisCache
- group: azure
Expand Down
6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/service.azure_storages.yaml
- bases/service.azure_cosmosdbs.yaml
- bases/service.azure_rediscaches.yaml
- bases/azure.microsoft.com_storages.yaml
- bases/azure.microsoft.com_cosmosdbs.yaml
- bases/azure.microsoft.com_rediscaches.yaml
- bases/azure.microsoft.com_eventhubs.yaml
- bases/azure.microsoft.com_resourcegroups.yaml
- bases/azure.microsoft.com_eventhubnamespaces.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_cosmosdbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
name: cosmosdbs.service.azure
name: cosmosdbs.azure.microsoft.com
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_rediscaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: rediscaches.service.azure
name: rediscaches.azure.microsoft.com
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_storages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME)
name: storages.service.azure
name: storages.azure.microsoft.com
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_cosmosdbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: cosmosdbs.service.azure
name: cosmosdbs.azure.microsoft.com
spec:
conversion:
strategy: Webhook
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_rediscaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: rediscaches.service.azure
name: rediscaches.azure.microsoft.com
spec:
conversion:
strategy: Webhook
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_storages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: storages.service.azure
name: storages.azure.microsoft.com
spec:
conversion:
strategy: Webhook
Expand Down
12 changes: 6 additions & 6 deletions config/default/manager_role_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: manager-role
rules:
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- cosmosdbs
verbs:
Expand All @@ -19,15 +19,15 @@ rules:
- update
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- cosmosdbs/status
verbs:
- get
- patch
- update
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- rediscaches
verbs:
Expand All @@ -39,15 +39,15 @@ rules:
- update
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- rediscaches/status
verbs:
- get
- patch
- update
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- storages
verbs:
Expand All @@ -59,7 +59,7 @@ rules:
- update
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- storages/status
verbs:
Expand Down
103 changes: 48 additions & 55 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- eventhubnamespaces
- cosmosdbs
verbs:
- create
- delete
Expand All @@ -29,35 +29,34 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- keyvaults
- events
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- rediscaches/status
- consumergroups
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- azure.microsoft.com
resources:
- resourcegroups/status
- consumergroups/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
- azure.microsoft.com
resources:
- eventhubnamespaces
- resourcegroups
verbs:
- create
- delete
Expand All @@ -69,15 +68,19 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- eventhubnamespaces/status
- storages
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- azure.microsoft.com
- ""
resources:
- eventhubs
- secrets
verbs:
- create
- delete
Expand All @@ -87,24 +90,29 @@ rules:
- update
- watch
- apiGroups:
- apps
- azure.microsoft.com
resources:
- deployments/status
- eventhubs/status
verbs:
- get
- patch
- update
- apiGroups:
- apps
- azure.microsoft.com
resources:
- deployments
- eventhubnamespaces
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
- azure.microsoft.com
resources:
- deployments
- keyvaults
verbs:
- create
- delete
Expand All @@ -116,31 +124,30 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- eventhubs/status
- rediscaches/status
verbs:
- get
- patch
- update
- apiGroups:
- azure.microsoft.com
- ""
resources:
- keyvaults/status
- events
verbs:
- get
- patch
- update
- create
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- storages/status
- cosmosdbs/status
verbs:
- get
- patch
- update
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- cosmosdbs
- eventhubs
verbs:
- create
- delete
Expand All @@ -152,17 +159,13 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- consumergroups/status
- keyvaults/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- service.azure
- azure.microsoft.com
resources:
- rediscaches
verbs:
Expand All @@ -176,26 +179,23 @@ rules:
- apiGroups:
- azure.microsoft.com
resources:
- resourcegroups
- resourcegroups/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- azure.microsoft.com
resources:
- events
- storages/status
verbs:
- create
- get
- patch
- update
- apiGroups:
- azure.microsoft.com
- apps
resources:
- consumergroups
- deployments
verbs:
- create
- delete
Expand All @@ -205,16 +205,9 @@ rules:
- update
- watch
- apiGroups:
- service.azure
resources:
- storages
verbs:
- create
- watch
- apiGroups:
- service.azure
- apps
resources:
- cosmosdbs/status
- deployments/status
verbs:
- get
- patch
Expand Down
4 changes: 2 additions & 2 deletions controllers/cosmosdb_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type CosmosDBReconciler struct {
RequeueTime time.Duration
}

// +kubebuilder:rbac:groups=service.azure,resources=cosmosdbs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=service.azure,resources=cosmosdbs/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=cosmosdbs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=cosmosdbs/status,verbs=get;update;patch

// Reconcile function does the main reconciliation loop of the operator
func (r *CosmosDBReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
Expand Down
4 changes: 2 additions & 2 deletions controllers/rediscache_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type RedisCacheReconciler struct {
RequeueTime time.Duration
}

// +kubebuilder:rbac:groups=service.azure,resources=rediscaches,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=service.azure,resources=rediscaches/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=rediscaches,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=rediscaches/status,verbs=get;update;patch

func (r *RedisCacheReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions controllers/storage_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type StorageReconciler struct {
RequeueTime time.Duration
}

// +kubebuilder:rbac:groups=service.azure,resources=storages,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=service.azure,resources=storages/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=storages,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=storages/status,verbs=get;update;patch

// Reconcile function does the main reconciliation loop of the operator
func (r *StorageReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/azure-vote-app-redis.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: service.azure/v1alpha1
apiVersion: azure.microsoft.com/v1alpha1
kind: RedisCache
metadata:
name: azure-redis
Expand Down