Skip to content

Commit 9522da0

Browse files
authored
Merge pull request #1120 from gianlucam76/fv-agentless-fix
(chore) fix functional verification for agentless mode
2 parents ff1a341 + 9885803 commit 9522da0

6 files changed

+147
-7
lines changed

Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fv-sharding: $(KUBECTL) $(GINKGO) ## Run Sveltos Controller tests using existing
248248

249249
.PHONY: fv-agentless
250250
fv-agentless: $(KUBECTL) $(GINKGO) ## Run Sveltos Controller tests using existing cluster
251-
$(KUBECTL) apply -f https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/mgmt_cluster_common_manifest.yaml
251+
$(KUBECTL) apply -f test/drift-detection-mgmt_cluster_common_manifest.yaml
252252
$(KUBECTL) apply -f manifest/drift_detection_manager_rbac.yaml
253253
cp manifest/deployment-agentless.yaml test/addon-controller-deployment-agentless.yaml
254254
$(KUBECTL) apply -f test/addon-controller-deployment-agentless.yaml
@@ -431,8 +431,11 @@ drift-detection-manager:
431431
@echo "Downloading drift detection manager yaml"
432432
$(eval digest :=$(call get-digest))
433433
@echo "image digest is $(digest)"
434-
curl -L https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/manifest.yaml -o ./pkg/drift-detection/drift-detection-manager.yaml
434+
curl -L -H "Authorization: token $$GITHUB_PAT" https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/manifest.yaml -o ./pkg/drift-detection/drift-detection-manager.yaml
435435
sed -i'' -e "s#image: docker.io/projectsveltos/drift-detection-manager:${TAG}#image: docker.io/projectsveltos/drift-detection-manager@${digest}#g" ./pkg/drift-detection/drift-detection-manager.yaml
436-
curl -L https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/mgmt_cluster_manifest.yaml -o ./pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.yaml
436+
curl -L -H "Authorization: token $$GITHUB_PAT" https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/mgmt_cluster_manifest.yaml -o ./pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.yaml
437437
sed -i'' -e "s#image: docker.io/projectsveltos/drift-detection-manager:${TAG}#image: docker.io/projectsveltos/drift-detection-manager@${digest}#g" ./pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.yaml
438438
cd pkg/drift-detection; go generate
439+
@echo "Downloading drift detection manager common yaml for agentless fv"
440+
curl -L -H "Authorization: token $$GITHUB_PAT" https://raw.githubusercontent.com/projectsveltos/drift-detection-manager/$(TAG)/manifest/mgmt_cluster_common_manifest.yaml -o ./test/drift-detection-mgmt_cluster_common_manifest.yaml
441+

pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ spec:
4747
- --version=main
4848
command:
4949
- /manager
50-
image: docker.io/projectsveltos/drift-detection-manager@sha256:f95c3d8328feeaf4e6b00615010c4c850cf772a948c4f2031f4ea732e4a11031
50+
image: docker.io/projectsveltos/drift-detection-manager@sha256:8f9e2d913dff4a38b85a5ca51157a004f3f67731be33a9fe05e695924c3e2cab
5151
livenessProbe:
5252
failureThreshold: 3
5353
httpGet:

pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
- --version=main
3030
command:
3131
- /manager
32-
image: docker.io/projectsveltos/drift-detection-manager@sha256:f95c3d8328feeaf4e6b00615010c4c850cf772a948c4f2031f4ea732e4a11031
32+
image: docker.io/projectsveltos/drift-detection-manager@sha256:8f9e2d913dff4a38b85a5ca51157a004f3f67731be33a9fe05e695924c3e2cab
3333
livenessProbe:
3434
failureThreshold: 3
3535
httpGet:

pkg/drift-detection/drift-detection-manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ spec:
141141
- --version=main
142142
command:
143143
- /manager
144-
image: docker.io/projectsveltos/drift-detection-manager@sha256:f95c3d8328feeaf4e6b00615010c4c850cf772a948c4f2031f4ea732e4a11031
144+
image: docker.io/projectsveltos/drift-detection-manager@sha256:8f9e2d913dff4a38b85a5ca51157a004f3f67731be33a9fe05e695924c3e2cab
145145
livenessProbe:
146146
failureThreshold: 3
147147
httpGet:

pkg/drift-detection/drift-detection-manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ spec:
123123
- --version=main
124124
command:
125125
- /manager
126-
image: docker.io/projectsveltos/drift-detection-manager@sha256:f95c3d8328feeaf4e6b00615010c4c850cf772a948c4f2031f4ea732e4a11031
126+
image: docker.io/projectsveltos/drift-detection-manager@sha256:8f9e2d913dff4a38b85a5ca51157a004f3f67731be33a9fe05e695924c3e2cab
127127
livenessProbe:
128128
failureThreshold: 3
129129
httpGet:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Those YAML are all needed when drift-detection-manager is started in the
2+
# management cluster. Those are not installed by addon-controller when deploying
3+
# drift-detection-manager in the management cluster to avoid granting addon-controller
4+
# extra permissions
5+
apiVersion: v1
6+
kind: ServiceAccount
7+
metadata:
8+
name: drift-detection-manager
9+
namespace: projectsveltos
10+
---
11+
# When running in the management cluster, drift-detection-manager needs
12+
# to access Secret containing Kubeconfig for managed cluster (and consequently
13+
# access Cluster/SveltosCluster to verify existance)
14+
apiVersion: rbac.authorization.k8s.io/v1
15+
kind: ClusterRole
16+
metadata:
17+
name: drift-detection-manager-role
18+
rules:
19+
- apiGroups:
20+
- ""
21+
resources:
22+
- configmaps
23+
verbs:
24+
- create
25+
- get
26+
- list
27+
- update
28+
- watch
29+
- apiGroups:
30+
- '*'
31+
resources:
32+
- '*'
33+
verbs:
34+
- get
35+
- list
36+
- watch
37+
- apiGroups:
38+
- authentication.k8s.io
39+
resources:
40+
- tokenreviews
41+
verbs:
42+
- create
43+
- apiGroups:
44+
- authorization.k8s.io
45+
resources:
46+
- subjectaccessreviews
47+
verbs:
48+
- create
49+
- apiGroups:
50+
- lib.projectsveltos.io
51+
resources:
52+
- debuggingconfigurations
53+
verbs:
54+
- get
55+
- list
56+
- watch
57+
- apiGroups:
58+
- lib.projectsveltos.io
59+
resources:
60+
- resourcesummaries
61+
verbs:
62+
- create
63+
- delete
64+
- get
65+
- list
66+
- patch
67+
- update
68+
- watch
69+
- apiGroups:
70+
- lib.projectsveltos.io
71+
resources:
72+
- resourcesummaries/finalizers
73+
verbs:
74+
- update
75+
- apiGroups:
76+
- lib.projectsveltos.io
77+
resources:
78+
- resourcesummaries/status
79+
verbs:
80+
- get
81+
- patch
82+
- update
83+
---
84+
apiVersion: rbac.authorization.k8s.io/v1
85+
kind: ClusterRole
86+
metadata:
87+
name: drift-detection-metrics-reader
88+
rules:
89+
- nonResourceURLs:
90+
- /metrics
91+
verbs:
92+
- get
93+
---
94+
apiVersion: rbac.authorization.k8s.io/v1
95+
kind: ClusterRole
96+
metadata:
97+
name: drift-detection-proxy-role
98+
rules:
99+
- apiGroups:
100+
- authentication.k8s.io
101+
resources:
102+
- tokenreviews
103+
verbs:
104+
- create
105+
- apiGroups:
106+
- authorization.k8s.io
107+
resources:
108+
- subjectaccessreviews
109+
verbs:
110+
- create
111+
---
112+
apiVersion: rbac.authorization.k8s.io/v1
113+
kind: ClusterRoleBinding
114+
metadata:
115+
name: drift-detection-manager-rolebinding
116+
roleRef:
117+
apiGroup: rbac.authorization.k8s.io
118+
kind: ClusterRole
119+
name: drift-detection-manager-role
120+
subjects:
121+
- kind: ServiceAccount
122+
name: drift-detection-manager
123+
namespace: projectsveltos
124+
---
125+
apiVersion: rbac.authorization.k8s.io/v1
126+
kind: ClusterRoleBinding
127+
metadata:
128+
name: drift-detection-proxy-rolebinding
129+
roleRef:
130+
apiGroup: rbac.authorization.k8s.io
131+
kind: ClusterRole
132+
name: drift-detection-proxy-role
133+
subjects:
134+
- kind: ServiceAccount
135+
name: drift-detection-manager
136+
namespace: projectsveltos
137+
---

0 commit comments

Comments
 (0)