Skip to content

Commit 672bb33

Browse files
committed
feat: add Secret controller
1 parent 298687b commit 672bb33

File tree

20 files changed

+936
-101
lines changed

20 files changed

+936
-101
lines changed

artifacts/crd.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,47 @@ spec:
124124
kind: GHS
125125
shortNames:
126126
- ghs
127+
128+
---
129+
apiVersion: apiextensions.k8s.io/v1
130+
kind: CustomResourceDefinition
131+
metadata:
132+
name: secrets.githubapp.technicaldomain.xyz
133+
spec:
134+
group: githubapp.technicaldomain.xyz
135+
versions:
136+
- name: v1
137+
served: true
138+
storage: true
139+
schema:
140+
openAPIV3Schema:
141+
type: object
142+
properties:
143+
spec:
144+
type: object
145+
properties:
146+
privateKeySecret:
147+
type: string
148+
secrets:
149+
type: array
150+
items:
151+
type: object
152+
properties:
153+
secret:
154+
type: string
155+
namespace:
156+
type: string
157+
status:
158+
type: object
159+
properties:
160+
token:
161+
type: string
162+
subresources:
163+
status: {}
164+
scope: Namespaced
165+
names:
166+
plural: secrets
167+
singular: secret
168+
kind: Secret
169+
shortNames:
170+
- sec

artifacts/example.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ spec:
88
argoCDRepositories:
99
- repository: repo-1294444111
1010
namespace: argocd
11-
# ---
12-
# apiVersion: githubapp.technicaldomain.xyz/v1
13-
# kind: ArgoCDRepo
14-
# metadata:
15-
# name: example-argo-another-github-app
16-
# namespace: default
17-
# spec:
18-
# privateKeySecret: github-app-private-key
19-
# argoCDRepositories:
20-
# - repository: repo-1294444122
21-
# namespace: argocd
11+
---
12+
apiVersion: githubapp.technicaldomain.xyz/v1
13+
kind: ArgoCDRepo
14+
metadata:
15+
name: example-argo-another-github-app
16+
namespace: default
17+
spec:
18+
privateKeySecret: github-app-private-key
19+
argoCDRepositories:
20+
- repository: repo-1294444122
21+
namespace: argocd
2222
---
2323
apiVersion: githubapp.technicaldomain.xyz/v1
2424
kind: DockerConfigJson
@@ -30,3 +30,18 @@ spec:
3030
dockerConfigSecrets:
3131
- secret: ghcr
3232
namespace: argocd
33+
registry: ghcr.io
34+
username: x-access-token
35+
---
36+
apiVersion: githubapp.technicaldomain.xyz/v1
37+
kind: Secret
38+
metadata:
39+
name: github-secret
40+
namespace: default
41+
spec:
42+
privateKeySecret: github-app-private-key
43+
secrets:
44+
- secret: ghs-app-token
45+
namespace: argocd
46+
- secret: ghs-app2-token
47+
namespace: default

controller_ghs.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2025 Alexander Kharkevich.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package main
218

319
import (

0 commit comments

Comments
 (0)