Skip to content

Commit 36ac337

Browse files
update crd
1 parent 05d59e2 commit 36ac337

5 files changed

Lines changed: 21 additions & 2 deletions

File tree

config/crd/cdbootstraps.cndev.nl.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ spec:
3636
replicas:
3737
type: integer
3838
format: int32
39+
url:
40+
type: string
41+
format: string
42+
pool:
43+
type: string
44+
format: string
3945
required:
4046
- replicas
47+
- pool
48+
- url
4149
status:
4250
type: object
4351
properties:

config/samples/cdbootstrap-example.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ metadata:
55
name: test-bootstrap # Name of the "bootstrap" custom resource instance, may be changed to your liking
66
#namespace: default # Namespace must exist and account in KUBECONFIG must have sufficient permissions
77
spec:
8+
url: https://dev.azure.com/DevOps-SST
9+
pool: poc-pool
810
replicas: 2 # Number of "bootstrap" pods created.

config/samples/update.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ metadata:
55
name: test-bootstrap # Name of the "bootstrap" custom resource instance, may be changed to your liking
66
#namespace: default # Namespace must exist and account in KUBECONFIG must have sufficient permissions
77
spec:
8+
url: https://dev.azure.com/DevOps-SST
9+
pool: poc-pool
810
replicas: 4 # Number of "bootstrap" pods created.

src/crd.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ use serde::{Deserialize, Serialize};
1818
pub struct CDBootstrapSpec {
1919
#[garde(skip)]
2020
pub replicas: i32,
21+
#[garde(skip)]
22+
pub url: String,
23+
#[garde(skip)]
24+
pub pool: String,
2125
}
2226

2327
#[derive(Deserialize, Serialize, Clone, Debug, Default, JsonSchema)]

src/subresources.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ impl AgentConfig {
230230
.cloned()
231231
.collect();
232232

233+
let url = cr.spec.url.clone();
234+
let pool = cr.spec.pool.clone();
235+
233236
// Define the NetworkPolicy configuration as JSON
234237
let configmap_json: Value = json!({
235238
"apiVersion": "v1",
@@ -240,8 +243,8 @@ impl AgentConfig {
240243
"labels": labels,
241244
},
242245
"data": {
243-
"AZP_POOL": "placeholder",
244-
"AZP_URL": "placeholder",
246+
"AZP_POOL": pool,
247+
"AZP_URL": url,
245248
"AZP_WORK": "placeholder",
246249
"AZP_AGENT_NAME": "placeholder",
247250
"AGENT_MTU_VALUE": "placeholder"

0 commit comments

Comments
 (0)