Skip to content

Commit b0a2ab8

Browse files
committed
Advance sveltos-agent
This picks this sveltos-agent optmization: Both sveltos-agent and the agents running in the control cluster (classifier, event-manager and healthcheck-manager) update status for ClassifierReport, EventReport and HealthCheckReport. Sveltos-agent updates it to indicate there is a new report to be processed. The agents in the control cluster to indicate the latest report has been processed. This PR optimizes the status update logic for the EventReport, HealthCheckReport, and ClassifierReport controllers. Previously, concurrent updates by multiple managers or controllers some time resulted in 409 Conflict errors. This forced the classifier/eventSource/healthCheck to be re-evaluated again. The code now attempts an immediate status update with the existing resourceVersion. It only performs a Get() request if a conflict is actually detected, saving one API call in ~90% of cases.
1 parent 2b13ca9 commit b0a2ab8

13 files changed

+21
-21
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ARCH ?= $(shell go env GOARCH)
4545
OS ?= $(shell uname -s | tr A-Z a-z)
4646
K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
4747
export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
48-
TAG ?= v1.5.0
48+
TAG ?= main
4949

5050
## Tool Binaries
5151
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen

config/default/manager_auth_proxy_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ spec:
1616
- "--shard-key="
1717
- --capi-onboard-annotation=
1818
- "--v=5"
19-
- "--version=v1.5.0"
19+
- "--version=main"
2020
- "--registry="
2121
- "--agent-in-mgmt-cluster=false"

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: docker.io/projectsveltos/classifier:v1.5.0
11+
- image: docker.io/projectsveltos/classifier:main
1212
name: manager

manifest/deployment-agentless.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ spec:
2424
- --shard-key=
2525
- --capi-onboard-annotation=
2626
- --v=5
27-
- --version=v1.5.0
27+
- --version=main
2828
- --registry=
2929
- --agent-in-mgmt-cluster=true
3030
command:
3131
- /manager
32-
image: docker.io/projectsveltos/classifier:v1.5.0
32+
image: docker.io/projectsveltos/classifier:main
3333
livenessProbe:
3434
failureThreshold: 3
3535
httpGet:

manifest/deployment-shard.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ spec:
2424
- --shard-key={{.SHARD}}
2525
- --capi-onboard-annotation=
2626
- --v=5
27-
- --version=v1.5.0
27+
- --version=main
2828
- --registry=
2929
- --agent-in-mgmt-cluster=false
3030
command:
3131
- /manager
32-
image: docker.io/projectsveltos/classifier:v1.5.0
32+
image: docker.io/projectsveltos/classifier:main
3333
livenessProbe:
3434
failureThreshold: 3
3535
httpGet:

manifest/manifest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ spec:
168168
- --shard-key=
169169
- --capi-onboard-annotation=
170170
- --v=5
171-
- --version=v1.5.0
171+
- --version=main
172172
- --registry=
173173
- --agent-in-mgmt-cluster=false
174174
command:
175175
- /manager
176-
image: docker.io/projectsveltos/classifier:v1.5.0
176+
image: docker.io/projectsveltos/classifier:main
177177
livenessProbe:
178178
failureThreshold: 3
179179
httpGet:

pkg/agent/sveltos-agent-in-mgmt-cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
- --cluster-namespace=
4343
- --cluster-name=
4444
- --cluster-type=
45-
- --version=v1.5.0
45+
- --version=main
4646
- --current-cluster=management-cluster
4747
- --run-mode=do-not-send-reports
4848
- --discard-managed-fields=true
@@ -57,7 +57,7 @@ spec:
5757
valueFrom:
5858
resourceFieldRef:
5959
resource: limits.cpu
60-
image: docker.io/projectsveltos/sveltos-agent@sha256:5789484c29dd153653fbd7d822e458348502d3a6d710d5661e26b17f7050d698
60+
image: docker.io/projectsveltos/sveltos-agent@sha256:f888233af1cf1737687668c03d1b683d47bbc7b728180ebf22b8485b6683b27e
6161
livenessProbe:
6262
failureThreshold: 3
6363
httpGet:

pkg/agent/sveltos-agent-in-mgmt-cluster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- --cluster-namespace=
2525
- --cluster-name=
2626
- --cluster-type=
27-
- --version=v1.5.0
27+
- --version=main
2828
- --current-cluster=management-cluster
2929
- --run-mode=do-not-send-reports
3030
- --discard-managed-fields=true
@@ -39,7 +39,7 @@ spec:
3939
valueFrom:
4040
resourceFieldRef:
4141
resource: limits.cpu
42-
image: docker.io/projectsveltos/sveltos-agent@sha256:5789484c29dd153653fbd7d822e458348502d3a6d710d5661e26b17f7050d698
42+
image: docker.io/projectsveltos/sveltos-agent@sha256:f888233af1cf1737687668c03d1b683d47bbc7b728180ebf22b8485b6683b27e
4343
livenessProbe:
4444
failureThreshold: 3
4545
httpGet:

pkg/agent/sveltos-agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ spec:
201201
- --cluster-namespace=
202202
- --cluster-name=
203203
- --cluster-type=
204-
- --version=v1.5.0
204+
- --version=main
205205
- --current-cluster=managed-cluster
206206
- --run-mode=do-not-send-reports
207207
- --discard-managed-fields=true
@@ -216,7 +216,7 @@ spec:
216216
valueFrom:
217217
resourceFieldRef:
218218
resource: limits.cpu
219-
image: docker.io/projectsveltos/sveltos-agent@sha256:5789484c29dd153653fbd7d822e458348502d3a6d710d5661e26b17f7050d698
219+
image: docker.io/projectsveltos/sveltos-agent@sha256:f888233af1cf1737687668c03d1b683d47bbc7b728180ebf22b8485b6683b27e
220220
livenessProbe:
221221
failureThreshold: 3
222222
httpGet:

pkg/agent/sveltos-agent.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ spec:
183183
- --cluster-namespace=
184184
- --cluster-name=
185185
- --cluster-type=
186-
- --version=v1.5.0
186+
- --version=main
187187
- --current-cluster=managed-cluster
188188
- --run-mode=do-not-send-reports
189189
- --discard-managed-fields=true
@@ -198,7 +198,7 @@ spec:
198198
valueFrom:
199199
resourceFieldRef:
200200
resource: limits.cpu
201-
image: docker.io/projectsveltos/sveltos-agent@sha256:5789484c29dd153653fbd7d822e458348502d3a6d710d5661e26b17f7050d698
201+
image: docker.io/projectsveltos/sveltos-agent@sha256:f888233af1cf1737687668c03d1b683d47bbc7b728180ebf22b8485b6683b27e
202202
livenessProbe:
203203
failureThreshold: 3
204204
httpGet:

0 commit comments

Comments
 (0)