Skip to content

Commit a4bec48

Browse files
committed
Update Makefile for local development; enhance deployment probe handling
1 parent 3801828 commit a4bec48

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ control-plane-dev-docker: ## Build consul-k8s-control-plane dev Docker image.
5555
--build-arg 'GIT_COMMIT=$(GIT_COMMIT)' \
5656
--build-arg 'GIT_DIRTY=$(GIT_DIRTY)' \
5757
--build-arg 'GIT_DESCRIBE=$(GIT_DESCRIBE)' \
58-
-f $(CURDIR)/control-plane/Dockerfile $(CURDIR)/control-plane
58+
-f $(CURDIR)/control-plane/Dockerfile $(CURDIR)/control-plane --load
5959

6060
.PHONY: control-plane-dev-skaffold
6161
# DANGER: this target is experimental and could be modified/removed at any time.

charts/consul/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ global:
8686
# image that is used for functionality such as catalog sync.
8787
# This can be overridden per component.
8888
# @default: hashicorp/consul-k8s-control-plane:<latest version>
89-
imageK8S: docker.mirror.hashicorp.services/hashicorppreview/consul-k8s-control-plane:1.10.0-dev
89+
imageK8S: consul-k8s-control-plane-dev:local
9090

9191
# The image pull policy used globally for images controlled by Consul (consul, consul-dataplane, consul-k8s, consul-telemetry-collector).
9292
# One of "IfNotPresent", "Always", "Never", and "". Refer to https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy

control-plane/api-gateway/gatekeeper/deployment.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,19 @@ func mergeDeployments(gcc v1alpha1.GatewayClassConfig, a, b *appsv1.Deployment)
173173
// Replace template
174174
b.Spec.Template = a.Spec.Template
175175

176-
// Restore probe configurations from existing deployment
176+
// Always preserve existing probe configurations (manual edits)
177177
for i, container := range b.Spec.Template.Spec.Containers {
178178
if existingContainer, exists := existingProbes[i]; exists {
179+
// Always preserve existing readiness probe if it exists
179180
if existingContainer.ReadinessProbe != nil {
180181
container.ReadinessProbe = existingContainer.ReadinessProbe
181182
}
182-
if existingContainer.LivenessProbe != nil {
183-
container.LivenessProbe = existingContainer.LivenessProbe
184-
}
183+
184+
// Always preserve existing startup probe if it exists
185185
if existingContainer.StartupProbe != nil {
186186
container.StartupProbe = existingContainer.StartupProbe
187187
}
188+
188189
b.Spec.Template.Spec.Containers[i] = container
189190
}
190191
}
@@ -246,15 +247,6 @@ func compareDeployments(a, b *appsv1.Deployment) bool {
246247
return false
247248
}
248249

249-
// Compare liveness probe initialDelaySeconds
250-
if container.LivenessProbe != nil && otherContainer.LivenessProbe != nil {
251-
if container.LivenessProbe.InitialDelaySeconds != otherContainer.LivenessProbe.InitialDelaySeconds {
252-
return false
253-
}
254-
} else if (container.LivenessProbe == nil) != (otherContainer.LivenessProbe == nil) {
255-
return false
256-
}
257-
258250
// Compare startup probe initialDelaySeconds
259251
if container.StartupProbe != nil && otherContainer.StartupProbe != nil {
260252
if container.StartupProbe.InitialDelaySeconds != otherContainer.StartupProbe.InitialDelaySeconds {

0 commit comments

Comments
 (0)