Skip to content

Commit f460879

Browse files
authored
fix: update debug skip probes annotation to be Kubernetes valid annotation (#9831)
1 parent 2648bec commit f460879

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs-v2/content/en/docs/workflows/debug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,13 @@ an event that can be used by tools like IDEs to establish a debug session.
391391
being terminated and restarted.
392392

393393
The probe timeout value can be set on a per-podspec basis by setting
394-
a `debug.cloud.google.com/probe/timeouts` annotation on the podspec's metadata
394+
a `debug.cloud.google.com/probe-timeouts` annotation on the podspec's metadata
395395
with a valid duration (see [Go's time.ParseDuration()](https://pkg.go.dev/time#ParseDuration)).
396396
This probe timeout-rewriting can be skipped entirely by using `skip`. For example:
397397
```yaml
398398
metadata:
399399
annotations:
400-
debug.cloud.google.com/probe/timeouts: skip
400+
debug.cloud.google.com/probe-timeouts: skip
401401
spec: ...
402402
```
403403

pkg/skaffold/debug/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727

2828
// DebugProbesAnnotation is the name of the podspec annotation that disables rewriting of probe timeouts.
2929
// The annotation value should be `skip`.
30-
DebugProbeTimeouts = "debug.cloud.google.com/probe/timeouts"
30+
DebugProbeTimeouts = "debug.cloud.google.com/probe-timeouts"
3131
)
3232

3333
// ContainerDebugConfiguration captures debugging information for a specific container.

pkg/skaffold/kubernetes/debugging/transform_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func TestRewriteProbes(t *testing.T) {
229229
name: "skips pod with skip-probes annotation",
230230
input: v1.Pod{
231231
TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.Version, Kind: "Pod"},
232-
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe/timeouts": `skip`}},
232+
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe-timeouts": `skip`}},
233233
Spec: v1.PodSpec{Containers: []v1.Container{{
234234
Name: "name1",
235235
Image: "image1",
@@ -240,15 +240,15 @@ func TestRewriteProbes(t *testing.T) {
240240
name: "processes pod with probes annotation with explicit timeout",
241241
input: v1.Pod{
242242
TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.Version, Kind: "Pod"},
243-
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe/timeouts": `1m`}},
243+
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe-timeouts": `1m`}},
244244
Spec: v1.PodSpec{Containers: []v1.Container{{
245245
Name: "name1",
246246
Image: "image1",
247247
LivenessProbe: &v1.Probe{ProbeHandler: v1.ProbeHandler{HTTPGet: &v1.HTTPGetAction{Path: "/", Port: intstr.FromInt(8080)}}, TimeoutSeconds: 1}}}}},
248248
changed: false,
249249
result: v1.Pod{
250250
TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.Version, Kind: "Pod"},
251-
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe/timeouts": `1m`}},
251+
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe-timeouts": `1m`}},
252252
Spec: v1.PodSpec{Containers: []v1.Container{{
253253
Name: "name1",
254254
Image: "image1",
@@ -258,15 +258,15 @@ func TestRewriteProbes(t *testing.T) {
258258
name: "processes pod with probes annotation with invalid timeout",
259259
input: v1.Pod{
260260
TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.Version, Kind: "Pod"},
261-
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe/timeouts": `on`}},
261+
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe-timeouts": `on`}},
262262
Spec: v1.PodSpec{Containers: []v1.Container{{
263263
Name: "name1",
264264
Image: "image1",
265265
LivenessProbe: &v1.Probe{ProbeHandler: v1.ProbeHandler{HTTPGet: &v1.HTTPGetAction{Path: "/", Port: intstr.FromInt(8080)}}, TimeoutSeconds: 1}}}}},
266266
changed: false,
267267
result: v1.Pod{
268268
TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.Version, Kind: "Pod"},
269-
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe/timeouts": `on`}},
269+
ObjectMeta: metav1.ObjectMeta{Name: "podname", Annotations: map[string]string{"debug.cloud.google.com/probe-timeouts": `on`}},
270270
Spec: v1.PodSpec{Containers: []v1.Container{{
271271
Name: "name1",
272272
Image: "image1",

0 commit comments

Comments
 (0)