diff --git a/api/v1alpha1/postgresqluser_types.go b/api/v1alpha1/postgresqluser_types.go index aaadba84927..e8dd64e108f 100644 --- a/api/v1alpha1/postgresqluser_types.go +++ b/api/v1alpha1/postgresqluser_types.go @@ -29,7 +29,6 @@ type PostgreSQLUserSpec struct { // +kubebuilder:subresource:status // PostgreSQLUser is the Schema for the postgresqlusers API -// +kubebuilder:resource:shortName=psqlu,path=psqluser // +kubebuilder:printcolumn:name="Provisioned",type="string",JSONPath=".status.provisioned" // +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message" type PostgreSQLUser struct { diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index a7eecb03ff2..d9dbfec4d13 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -63,6 +63,7 @@ patches: #- patches/webhook_in_postgresqldatabases.yaml #- patches/webhook_in_postgresqlfirewallrules.yaml #- patches/webhook_in_postgresqlvnetrules.yaml +#- patches/webhook_in_postgresqlusers.yaml #- patches/webhook_in_apimservices.yaml #- patches/webhook_in_apimgmtapis.yaml #- patches/webhook_in_virtualnetworks.yaml @@ -102,6 +103,7 @@ patches: #- patches/cainjection_in_postgresqldatabases.yaml #- patches/cainjection_in_postgresqlfirewallrules.yaml #- patches/cainjection_in_postgresqlvnetrules.yaml +#- patches/cainjection_in_postgresqlusers.yaml #- patches/cainjection_in_apimservices.yaml #- patches/cainjection_in_apimgmtapis.yaml #- patches/cainjection_in_virtualnetworks.yaml diff --git a/config/crd/patches/cainjection_in_postgresqlusers.yaml b/config/crd/patches/cainjection_in_postgresqlusers.yaml index d2c81e8115c..068dd2de7f4 100644 --- a/config/crd/patches/cainjection_in_postgresqlusers.yaml +++ b/config/crd/patches/cainjection_in_postgresqlusers.yaml @@ -5,4 +5,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: psqlusers.azure.microsoft.com + name: postgresqlusers.azure.microsoft.com diff --git a/config/rbac/postgresqluser_editor_role.yaml b/config/rbac/postgresqluser_editor_role.yaml index fcb256f4671..9788b71441c 100644 --- a/config/rbac/postgresqluser_editor_role.yaml +++ b/config/rbac/postgresqluser_editor_role.yaml @@ -1,4 +1,4 @@ -# permissions to do edit mysqlusers. +# permissions for end users to edit postgresqlusers. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -19,9 +19,6 @@ rules: - apiGroups: - azure.microsoft.com resources: - - postgre - sqlusers/status + - postgresqlusers/status verbs: - get - - patch - - update diff --git a/config/rbac/postgresqluser_viewer_role.yaml b/config/rbac/postgresqluser_viewer_role.yaml index 2cceadb4b0c..36c9f944031 100644 --- a/config/rbac/postgresqluser_viewer_role.yaml +++ b/config/rbac/postgresqluser_viewer_role.yaml @@ -1,4 +1,4 @@ -# permissions to do viewer mysqlusers. +# permissions for end users to view postgresqlusers. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/go.mod b/go.mod index 677e09ad206..dd342db2c6b 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/uuid v1.1.1 github.com/hashicorp/go-multierror v1.0.0 - github.com/lib/pq v1.6.0 // indirect + github.com/lib/pq v1.6.0 github.com/marstr/randname v0.0.0-20181206212954-d5b0f288ab8c github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.3.0 // indirect diff --git a/main.go b/main.go index 3104ff2fcb8..0b59c53f26f 100644 --- a/main.go +++ b/main.go @@ -91,6 +91,8 @@ func init() { // +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=azure.microsoft.com,resources=events,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=azure.microsoft.com,resources=azuresqlusers,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=postgresqlusers,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=postgresqlusers/status,verbs=get;update;patch // +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch