diff --git a/PROJECT b/PROJECT index bf33b59a4d7..934b81867b5 100644 --- a/PROJECT +++ b/PROJECT @@ -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 diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index d2d171c55e8..75e2efb5492 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -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 diff --git a/config/crd/patches/cainjection_in_cosmosdbs.yaml b/config/crd/patches/cainjection_in_cosmosdbs.yaml index d14bfce13fd..d46088c8c24 100644 --- a/config/crd/patches/cainjection_in_cosmosdbs.yaml +++ b/config/crd/patches/cainjection_in_cosmosdbs.yaml @@ -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 diff --git a/config/crd/patches/cainjection_in_rediscaches.yaml b/config/crd/patches/cainjection_in_rediscaches.yaml index 56a5e83784e..0945e3cbe00 100644 --- a/config/crd/patches/cainjection_in_rediscaches.yaml +++ b/config/crd/patches/cainjection_in_rediscaches.yaml @@ -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 diff --git a/config/crd/patches/cainjection_in_storages.yaml b/config/crd/patches/cainjection_in_storages.yaml index e371d696a51..a5669e97b77 100644 --- a/config/crd/patches/cainjection_in_storages.yaml +++ b/config/crd/patches/cainjection_in_storages.yaml @@ -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 diff --git a/config/crd/patches/webhook_in_cosmosdbs.yaml b/config/crd/patches/webhook_in_cosmosdbs.yaml index 7ecf9d9fe29..d06ad93537e 100644 --- a/config/crd/patches/webhook_in_cosmosdbs.yaml +++ b/config/crd/patches/webhook_in_cosmosdbs.yaml @@ -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 diff --git a/config/crd/patches/webhook_in_rediscaches.yaml b/config/crd/patches/webhook_in_rediscaches.yaml index 3a0e04368dc..21f9b0e36d9 100644 --- a/config/crd/patches/webhook_in_rediscaches.yaml +++ b/config/crd/patches/webhook_in_rediscaches.yaml @@ -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 diff --git a/config/crd/patches/webhook_in_storages.yaml b/config/crd/patches/webhook_in_storages.yaml index 5811750b289..51d315b7a6e 100644 --- a/config/crd/patches/webhook_in_storages.yaml +++ b/config/crd/patches/webhook_in_storages.yaml @@ -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 diff --git a/config/default/manager_role_patch.yaml b/config/default/manager_role_patch.yaml index ecf4ba85b76..958bbcc3a46 100644 --- a/config/default/manager_role_patch.yaml +++ b/config/default/manager_role_patch.yaml @@ -7,7 +7,7 @@ metadata: name: manager-role rules: - apiGroups: - - service.azure + - azure.microsoft.com resources: - cosmosdbs verbs: @@ -19,7 +19,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - cosmosdbs/status verbs: @@ -27,7 +27,7 @@ rules: - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - rediscaches verbs: @@ -39,7 +39,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - rediscaches/status verbs: @@ -47,7 +47,7 @@ rules: - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - storages verbs: @@ -59,7 +59,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - storages/status verbs: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index c6c019485c2..3ce5e03273b 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -9,7 +9,7 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces + - cosmosdbs verbs: - create - delete @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/controllers/cosmosdb_controller.go b/controllers/cosmosdb_controller.go index 28d019538c7..4691d0619df 100644 --- a/controllers/cosmosdb_controller.go +++ b/controllers/cosmosdb_controller.go @@ -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) { diff --git a/controllers/rediscache_controller.go b/controllers/rediscache_controller.go index b8cfef9064c..ff0e0808938 100644 --- a/controllers/rediscache_controller.go +++ b/controllers/rediscache_controller.go @@ -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() diff --git a/controllers/storage_controller.go b/controllers/storage_controller.go index 6408f88709f..d96ce920007 100644 --- a/controllers/storage_controller.go +++ b/controllers/storage_controller.go @@ -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) { diff --git a/examples/demo/azure-vote-app-redis.yaml b/examples/demo/azure-vote-app-redis.yaml index 6609a498a14..a15c582af8e 100644 --- a/examples/demo/azure-vote-app-redis.yaml +++ b/examples/demo/azure-vote-app-redis.yaml @@ -1,4 +1,4 @@ -apiVersion: service.azure/v1alpha1 +apiVersion: azure.microsoft.com/v1alpha1 kind: RedisCache metadata: name: azure-redis