From ed75d101af113e783848920047b1cfdaef6cc49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Y=C4=B1lmaz?= Date: Wed, 22 Jan 2025 11:15:03 +0100 Subject: [PATCH] feat(github-guard): add new crd GithubAccountLink (#580) --- github-guard/charts/Chart.yaml | 4 +- .../charts/crds/githubaccountlink-crd.yaml | 65 +++++++++++++++++++ .../charts/templates/manager-rbac.yaml | 8 +++ github-guard/plugindefinition.yaml | 4 +- 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 github-guard/charts/crds/githubaccountlink-crd.yaml diff --git a/github-guard/charts/Chart.yaml b/github-guard/charts/Chart.yaml index 22efce91..a53e1d7f 100644 --- a/github-guard/charts/Chart.yaml +++ b/github-guard/charts/Chart.yaml @@ -5,5 +5,5 @@ apiVersion: v2 name: github-guard description: A Helm chart for Kubernetes type: application -version: 0.5.0 -appVersion: "0.5.0" +version: 1.0.0 +appVersion: "1.0.0" diff --git a/github-guard/charts/crds/githubaccountlink-crd.yaml b/github-guard/charts/crds/githubaccountlink-crd.yaml new file mode 100644 index 00000000..b77d195f --- /dev/null +++ b/github-guard/charts/crds/githubaccountlink-crd.yaml @@ -0,0 +1,65 @@ +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: githubaccountlinks.githubguard.sap +spec: + group: githubguard.sap + names: + kind: GithubAccountLink + listKind: GithubAccountLinkList + plural: githubaccountlinks + singular: githubaccountlink + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.github + name: Github + type: string + - jsonPath: .spec.userID + name: User + type: string + - jsonPath: .spec.githubUserID + name: Github ID + type: string + name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + properties: + github: + type: string + githubUserID: + type: string + userID: + type: string + type: object + status: + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/github-guard/charts/templates/manager-rbac.yaml b/github-guard/charts/templates/manager-rbac.yaml index 3988df68..bc4ba6af 100644 --- a/github-guard/charts/templates/manager-rbac.yaml +++ b/github-guard/charts/templates/manager-rbac.yaml @@ -96,6 +96,14 @@ rules: - get - list - watch +- apiGroups: + - githubguard.sap + resources: + - githubaccountlinks + verbs: + - get + - list + - watch - apiGroups: - "" resources: diff --git a/github-guard/plugindefinition.yaml b/github-guard/plugindefinition.yaml index 0bbfc8a6..21f8840a 100644 --- a/github-guard/plugindefinition.yaml +++ b/github-guard/plugindefinition.yaml @@ -6,7 +6,7 @@ kind: PluginDefinition metadata: name: github-guard spec: - version: "0.5.0" + version: "1.0.0" displayName: Github Guard description: Manages Github teams, team memberships and repository & team assignments docMarkDownUrl: https://raw.githubusercontent.com/cloudoperators/greenhouse-extensions/main/github-guard/README.md @@ -14,4 +14,4 @@ spec: helmChart: name: github-guard repository: oci://ghcr.io/cloudoperators/greenhouse-extensions/charts - version: 0.5.0 + version: 1.0.0