Skip to content

Commit 49cafd6

Browse files
SaphMBsenglezou
andcommitted
chore: refactor dex promise to remove promise dependencies key
Signed-off-by: Stella Englezou <stella@syntasso.io> Co-authored-by: Stella Englezou <stella@syntasso.io>
1 parent 1ebc5ce commit 49cafd6

7 files changed

Lines changed: 20 additions & 181 deletions

File tree

.github/workflows/test-promise.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,6 @@ jobs:
5959
./scripts/register-destination --name platform-cluster --context kind-platform --state-store default --with-label environment=platform
6060
6161
kubectl wait --for condition=available -n kratix-platform-system deployment/kratix-platform-controller-manager --timeout 60s
62-
- name: Install worker-resource-builder
63-
if: ${{ matrix.promise_dir == 'dex-group-authentication' }}
64-
run: |
65-
curl -sLo ~/bin/worker-resource-builder.tar.gz https://github.com/syntasso/kratix/releases/download/v0.0.5/worker-resource-builder_0.0.5_linux_amd64.tar.gz
66-
tar -xvf ~/bin/worker-resource-builder.tar.gz -C ~/bin
67-
mv ~/bin/worker-resource-builder-v* ~/bin/worker-resource-builder
68-
chmod +x ~/bin/worker-resource-builder
69-
- name: Validate that there are no pending changes
70-
if: ${{ matrix.promise_dir == 'dex-group-authentication' }}
71-
run: |
72-
./internal/scripts/inject-deps
73-
if ! git diff --exit-code .; then
74-
echo ""
75-
echo "Changes in the dependencies were detected"
76-
echo "Injection of dependencies via CI is not supported. Please commit and push them manually."
77-
exit 1
78-
fi
7962
- name: Install Promise
8063
working-directory: ${{ matrix.promise_dir }}
8164
run: |

dex-group-authentication/internal/configure-pipeline/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN [ "mkdir", "/tmp/transfer" ]
77
RUN apk update && apk add --no-cache yq
88

99
ADD resources/* /tmp/transfer/
10-
ADD execute-pipeline execute-pipeline
10+
ADD resource-configure /usr/local/bin/resource-configure
11+
ADD promise-configure /usr/local/bin/promise-configure
1112

12-
CMD [ "sh", "-c", "./execute-pipeline" ]
13-
ENTRYPOINT []
13+
RUN chmod +x /usr/local/bin/*

dex-group-authentication/internal/dependencies/dex.yaml renamed to dex-group-authentication/internal/configure-pipeline/dependencies/dex.yaml

File renamed without changes.

dex-group-authentication/internal/dependencies/oidc-clusterrolebinding.yaml renamed to dex-group-authentication/internal/configure-pipeline/dependencies/oidc-clusterrolebinding.yaml

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
set -eux
4+
5+
echo "copying deps"
6+
7+
cp /dependencies/* /kratix/output/

dex-group-authentication/internal/configure-pipeline/execute-pipeline renamed to dex-group-authentication/internal/configure-pipeline/resource-configure

File renamed without changes.

dex-group-authentication/promise.yaml

Lines changed: 10 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -34,170 +34,18 @@ spec:
3434
type: object
3535
served: true
3636
storage: true
37-
dependencies:
38-
- apiVersion: v1
39-
kind: Namespace
40-
metadata:
41-
name: dex
42-
- apiVersion: v1
43-
kind: ServiceAccount
44-
metadata:
45-
labels:
46-
app: dex
47-
name: dex
48-
namespace: dex
49-
- apiVersion: rbac.authorization.k8s.io/v1
50-
kind: ClusterRole
51-
metadata:
52-
name: dex
53-
namespace: default
54-
rules:
55-
- apiGroups:
56-
- dex.coreos.com
57-
resources:
58-
- '*'
59-
verbs:
60-
- '*'
61-
- apiGroups:
62-
- apiextensions.k8s.io
63-
resources:
64-
- customresourcedefinitions
65-
verbs:
66-
- create
67-
- apiVersion: rbac.authorization.k8s.io/v1
68-
kind: ClusterRoleBinding
69-
metadata:
70-
name: dex
71-
namespace: default
72-
roleRef:
73-
apiGroup: rbac.authorization.k8s.io
74-
kind: ClusterRole
75-
name: dex
76-
subjects:
77-
- kind: ServiceAccount
78-
name: dex
79-
namespace: dex
80-
- apiVersion: v1
81-
data:
82-
config.yaml: |
83-
issuer: https://localhost:32000
84-
storage:
85-
type: kubernetes
86-
config:
87-
inCluster: true
88-
web:
89-
https: 0.0.0.0:5556
90-
tlsCert: /etc/dex/tls/tls.crt
91-
tlsKey: /etc/dex/tls/tls.key
92-
connectors:
93-
- type: github
94-
id: github
95-
name: GitHub
96-
config:
97-
clientID: $GITHUB_CLIENT_ID
98-
clientSecret: $GITHUB_CLIENT_SECRET
99-
redirectURI: https://localhost:32000/callback
100-
loadAllGroups: true
101-
staticClients:
102-
- id: kube
103-
redirectURIs:
104-
- http://localhost:8000
105-
- http://localhost:18000
106-
name: kubernetes
107-
secret: ZXhhbXBsZS1hcHAtc2VjcmV0
108-
kind: ConfigMap
109-
metadata:
110-
name: dex
111-
namespace: dex
112-
- apiVersion: v1
113-
kind: Service
114-
metadata:
115-
name: dex
116-
namespace: dex
117-
spec:
118-
ports:
119-
- name: dex
120-
nodePort: 32000
121-
port: 5556
122-
protocol: TCP
123-
targetPort: 5556
124-
selector:
125-
app: dex
126-
type: NodePort
127-
- apiVersion: apps/v1
128-
kind: Deployment
129-
metadata:
130-
labels:
131-
app: dex
132-
name: dex
133-
namespace: dex
134-
spec:
135-
replicas: 2
136-
selector:
137-
matchLabels:
138-
app: dex
139-
template:
37+
workflows:
38+
promise:
39+
configure:
40+
- apiVersion: platform.kratix.io/v1alpha1
41+
kind: Pipeline
14042
metadata:
141-
labels:
142-
app: dex
43+
name: promise-config
14344
spec:
14445
containers:
145-
- command:
146-
- /usr/local/bin/dex
147-
- serve
148-
- /etc/dex/cfg/config.yaml
149-
env:
150-
- name: GITHUB_CLIENT_ID
151-
valueFrom:
152-
secretKeyRef:
153-
key: client-id
154-
name: github-client
155-
- name: GITHUB_CLIENT_SECRET
156-
valueFrom:
157-
secretKeyRef:
158-
key: client-secret
159-
name: github-client
160-
image: ghcr.io/dexidp/dex:v2.30.0
161-
name: dex
162-
ports:
163-
- containerPort: 5556
164-
name: https
165-
readinessProbe:
166-
httpGet:
167-
path: /healthz
168-
port: 5556
169-
scheme: HTTPS
170-
volumeMounts:
171-
- mountPath: /etc/dex/cfg
172-
name: config
173-
- mountPath: /etc/dex/tls
174-
name: tls
175-
serviceAccountName: dex
176-
volumes:
177-
- configMap:
178-
items:
179-
- key: config.yaml
180-
path: config.yaml
181-
name: dex
182-
name: config
183-
- name: tls
184-
secret:
185-
secretName: dex.example.com.tls
186-
- apiVersion: rbac.authorization.k8s.io/v1
187-
kind: ClusterRoleBinding
188-
metadata:
189-
name: oidc-cluster-admin
190-
namespace: default
191-
roleRef:
192-
apiGroup: rbac.authorization.k8s.io
193-
kind: ClusterRole
194-
name: cluster-admin
195-
subjects:
196-
- apiGroup: rbac.authorization.k8s.io
197-
kind: User
198-
name: https://localhost:32000#CgcxNTU3MzQ2EgZnaXRodWI
199-
workflows:
200-
promise: {}
46+
- image: ghcr.io/syntasso/kratix-marketplace/dex-group-authentication-configure-pipeline:v0.1.0
47+
name: dex-group-auth-config-pipeline
48+
command: [ promise-configure ]
20149
resource:
20250
configure:
20351
- apiVersion: platform.kratix.io/v1alpha1
@@ -208,4 +56,5 @@ spec:
20856
containers:
20957
- image: ghcr.io/syntasso/kratix-marketplace/dex-group-authentication-configure-pipeline:v0.1.0
21058
name: dex-group-auth-config-pipeline
59+
command: [ resource-configure ]
21160
status: {}

0 commit comments

Comments
 (0)