diff --git a/charts/manager/crds/greenhouse.sap_teams.yaml b/charts/manager/crds/greenhouse.sap_teams.yaml index dc749ae56..2ed83cd96 100644 --- a/charts/manager/crds/greenhouse.sap_teams.yaml +++ b/charts/manager/crds/greenhouse.sap_teams.yaml @@ -65,6 +65,29 @@ spec: status: description: TeamStatus defines the observed state of Team properties: + members: + items: + description: User specifies a human person. + properties: + email: + description: Email of the user. + type: string + firstName: + description: FirstName of the user. + type: string + id: + description: ID is the unique identifier of the user. + type: string + lastName: + description: LastName of the user. + type: string + required: + - email + - firstName + - id + - lastName + type: object + type: array statusConditions: description: |- A StatusConditions contains a list of conditions. @@ -105,6 +128,7 @@ spec: x-kubernetes-list-type: map type: object required: + - members - statusConditions type: object type: object diff --git a/charts/manager/templates/role.yaml b/charts/manager/templates/role.yaml new file mode 100644 index 000000000..d0508edcd --- /dev/null +++ b/charts/manager/templates/role.yaml @@ -0,0 +1,157 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: manager-role +rules: +- apiGroups: + - "" + resources: + - events + - secrets + - serviceaccounts + verbs: + - create + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - namespaces + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' +- apiGroups: + - dex.coreos.com + resources: + - connectors + - oauth2clients + verbs: + - create + - get + - list + - patch + - update + - watch +- apiGroups: + - greenhouse.sap + resources: + - cluster-kubeconfigs + - teamroles + verbs: + - create + - get + - list + - patch + - update + - watch +- apiGroups: + - greenhouse.sap + resources: + - clusters + - organizations + - plugindefinitions + - plugins + - teammemberships + - teamrolebindings + - teams + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - greenhouse.sap + resources: + - clusters/finalizers + - organizations/finalizers + - plugindefinitions/finalizers + - pluginpresets/finalizers + - plugins/finalizers + - teammemberships/finalizers + - teamrolebindings/finalizers + - teams/finalizers + verbs: + - update +- apiGroups: + - greenhouse.sap + resources: + - clusters/status + - organizations/status + - plugindefinitions/status + - pluginpresets/status + - teammemberships/status + - teamrolebindings/status + - teams/status + verbs: + - get + - patch + - update +- apiGroups: + - greenhouse.sap + resources: + - pluginpresets + verbs: + - get + - list + - update + - watch +- apiGroups: + - greenhouse.sap + resources: + - plugins/status + verbs: + - get + - list + - patch + - update + - watch +- apiGroups: + - greenhouse.sap + resources: + - teammemberships= + verbs: + - get + - list +- apiGroups: + - rbac + resources: + - clusterrolebindings + verbs: + - create + - get + - list + - patch + - update + - watch +- apiGroups: + - rbac.authorization.k8s.io + resources: + - clusterrolebindings + - clusterroles + - rolebindings + - roles + verbs: + - create + - get + - list + - patch + - update + - watch diff --git a/charts/manager/templates/webhooks.yaml b/charts/manager/templates/webhooks.yaml index 9191734e2..ef01c86b1 100644 --- a/charts/manager/templates/webhooks.yaml +++ b/charts/manager/templates/webhooks.yaml @@ -4,392 +4,380 @@ kind: MutatingWebhookConfiguration metadata: name: greenhouse-mutating-webhook-configuration webhooks: - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-cluster - failurePolicy: Fail - name: mcluster.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - clusters - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-organization - failurePolicy: Fail - name: morganization.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - organizations - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-plugin - failurePolicy: Fail - name: mplugin.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - plugins - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-plugindefinition - failurePolicy: Fail - name: mplugindefinition.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - plugindefinitions - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-pluginpreset - failurePolicy: Fail - name: mpluginpreset.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - pluginpresets - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-teamrole - failurePolicy: Fail - name: mrole.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - teamroles - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-teamrolebinding - failurePolicy: Fail - name: mrolebinding.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - teamrolebindings - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate--v1-secret - failurePolicy: Ignore - matchPolicy: Exact - name: msecret.kb.io - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - resources: - - secrets - sideEffects: None - namespaceSelector: - matchExpressions: - - key: kubernetes.io/metadata.name - operator: NotIn - values: - - kube-system - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /mutate-greenhouse-sap-v1alpha1-team - failurePolicy: Fail - name: mteam.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - resources: - - teams - sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-cluster + failurePolicy: Fail + name: mcluster.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - clusters + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-organization + failurePolicy: Fail + name: morganization.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - organizations + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-plugin + failurePolicy: Fail + name: mplugin.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - plugins + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-plugindefinition + failurePolicy: Fail + name: mplugindefinition.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - plugindefinitions + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-pluginpreset + failurePolicy: Fail + name: mpluginpreset.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - pluginpresets + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-teamrole + failurePolicy: Fail + name: mrole.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - teamroles + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-teamrolebinding + failurePolicy: Fail + name: mrolebinding.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - teamrolebindings + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate--v1-secret + failurePolicy: Ignore + matchPolicy: Exact + name: msecret.kb.io + rules: + - apiGroups: + - "" + apiVersions: + - v1 + operations: + - CREATE + - UPDATE + resources: + - secrets + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /mutate-greenhouse-sap-v1alpha1-team + failurePolicy: Fail + name: mteam.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - teams + sideEffects: None --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: greenhouse-validating-webhook-configuration webhooks: - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-cluster - failurePolicy: Fail - name: vcluster.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - clusters - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-organization - failurePolicy: Fail - name: vorganization.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - organizations - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-plugin - failurePolicy: Fail - name: vplugin.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - plugins - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-plugindefinition - failurePolicy: Fail - name: vplugindefinition.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - plugindefinitions - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-pluginpreset - failurePolicy: Fail - name: vpluginpreset.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - pluginpresets - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-teamrole - failurePolicy: Fail - name: vrole.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - teamroles - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-teamrolebinding - failurePolicy: Fail - name: vrolebinding.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - teamrolebindings - sideEffects: None - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate--v1-secret - failurePolicy: Ignore - matchPolicy: Exact - name: vsecret.kb.io - rules: - - apiGroups: - - "" - apiVersions: - - v1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - secrets - sideEffects: None - namespaceSelector: - matchExpressions: - - key: kubernetes.io/metadata.name - operator: NotIn - values: - - kube-system - - admissionReviewVersions: - - v1 - clientConfig: - service: - name: greenhouse-webhook-service - namespace: greenhouse - path: /validate-greenhouse-sap-v1alpha1-team - failurePolicy: Fail - name: vteam.kb.io - rules: - - apiGroups: - - greenhouse.sap - apiVersions: - - v1alpha1 - operations: - - CREATE - - UPDATE - - DELETE - resources: - - teams - sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-cluster + failurePolicy: Fail + name: vcluster.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - clusters + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-organization + failurePolicy: Fail + name: vorganization.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - organizations + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-plugin + failurePolicy: Fail + name: vplugin.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - plugins + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-plugindefinition + failurePolicy: Fail + name: vplugindefinition.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - plugindefinitions + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-pluginpreset + failurePolicy: Fail + name: vpluginpreset.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - pluginpresets + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-teamrole + failurePolicy: Fail + name: vrole.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - teamroles + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-teamrolebinding + failurePolicy: Fail + name: vrolebinding.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - teamrolebindings + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate--v1-secret + failurePolicy: Ignore + matchPolicy: Exact + name: vsecret.kb.io + rules: + - apiGroups: + - "" + apiVersions: + - v1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - secrets + sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: greenhouse-webhook-service + namespace: greenhouse + path: /validate-greenhouse-sap-v1alpha1-team + failurePolicy: Fail + name: vteam.kb.io + rules: + - apiGroups: + - greenhouse.sap + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + - DELETE + resources: + - teams + sideEffects: None diff --git a/cmd/greenhouse/controllers.go b/cmd/greenhouse/controllers.go index 9803b9ee7..c714c03e7 100644 --- a/cmd/greenhouse/controllers.go +++ b/cmd/greenhouse/controllers.go @@ -23,6 +23,7 @@ var knownControllers = map[string]func(controllerName string, mgr ctrl.Manager) "organizationController": startOrganizationReconciler, // Team controllers. + "teamController": (&teamcontrollers.TeamReconciler{}).SetupWithManager, "teamPropagation": (&teamcontrollers.TeamPropagationReconciler{}).SetupWithManager, // TeamMembership controllers. diff --git a/docs/reference/api/index.html b/docs/reference/api/index.html index 4e4288a4a..dfd54a0fd 100644 --- a/docs/reference/api/index.html +++ b/docs/reference/api/index.html @@ -3456,6 +3456,18 @@
members
(Appears on: -TeamMembershipSpec) +TeamMembershipSpec, +TeamStatus)
User specifies a human person.