From a67490d6c52f4ce1830fd923b510cd37ad5efeb7 Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Wed, 30 Oct 2024 10:18:47 +0100
Subject: [PATCH] Remove image_digest input regex for now

We cannot use it because of
https://gitlab.com/gitlab-org/gitlab/-/issues/477707
---
 templates/apply.yml                 | 5 ++++-
 templates/custom-command.yml        | 5 ++++-
 templates/destroy.yml               | 5 ++++-
 templates/fmt.yml                   | 5 ++++-
 templates/full-pipeline.yml         | 5 ++++-
 templates/graph.yml                 | 5 ++++-
 templates/job-templates.yml         | 5 ++++-
 templates/plan.yml                  | 5 ++++-
 templates/test.yml                  | 5 ++++-
 templates/validate-plan-apply.yml   | 5 ++++-
 templates/validate-plan-destroy.yml | 5 ++++-
 templates/validate-plan.yml         | 5 ++++-
 templates/validate.yml              | 5 ++++-
 13 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/templates/apply.yml b/templates/apply.yml
index ed26796..90adf39 100644
--- a/templates/apply.yml
+++ b/templates/apply.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/custom-command.yml b/templates/custom-command.yml
index 16ce8d5..3fc7022 100644
--- a/templates/custom-command.yml
+++ b/templates/custom-command.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/destroy.yml b/templates/destroy.yml
index d91c490..9975044 100644
--- a/templates/destroy.yml
+++ b/templates/destroy.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/fmt.yml b/templates/fmt.yml
index c9ca935..b732794 100644
--- a/templates/fmt.yml
+++ b/templates/fmt.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/full-pipeline.yml b/templates/full-pipeline.yml
index 4261b77..265d27e 100644
--- a/templates/full-pipeline.yml
+++ b/templates/full-pipeline.yml
@@ -69,7 +69,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/graph.yml b/templates/graph.yml
index 3ec38af..7a0a0d0 100644
--- a/templates/graph.yml
+++ b/templates/graph.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/job-templates.yml b/templates/job-templates.yml
index 8767a31..448d0ad 100644
--- a/templates/job-templates.yml
+++ b/templates/job-templates.yml
@@ -69,7 +69,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/plan.yml b/templates/plan.yml
index 3fd49ec..cf6e789 100644
--- a/templates/plan.yml
+++ b/templates/plan.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/test.yml b/templates/test.yml
index f11343f..2f4894b 100644
--- a/templates/test.yml
+++ b/templates/test.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/validate-plan-apply.yml b/templates/validate-plan-apply.yml
index 75d7a43..04fdb4d 100644
--- a/templates/validate-plan-apply.yml
+++ b/templates/validate-plan-apply.yml
@@ -63,7 +63,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/validate-plan-destroy.yml b/templates/validate-plan-destroy.yml
index a801d93..e1c0b2d 100644
--- a/templates/validate-plan-destroy.yml
+++ b/templates/validate-plan-destroy.yml
@@ -63,7 +63,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/validate-plan.yml b/templates/validate-plan.yml
index fd1eb1f..709901f 100644
--- a/templates/validate-plan.yml
+++ b/templates/validate-plan.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
diff --git a/templates/validate.yml b/templates/validate.yml
index 2f0306f..f88189c 100644
--- a/templates/validate.yml
+++ b/templates/validate.yml
@@ -60,7 +60,10 @@ spec:
 
     image_digest:
       default: ''
-      regex: '^(@sha256:[a-z0-9]{64})?$'
+      # FIXME: we cannot use regex yet because of a bug that rejects
+      # empty strings from ever being checked against the regex.
+      # see https://gitlab.com/gitlab-org/gitlab/-/issues/477707
+      # regex: '^(@sha256:[a-z0-9]{64})?$'
       description: 'Image digest of the image you want to use. The format must be `@<image_digest>`, e.g. `@sha256:abc..`, see regex of this input. Please consult the release page at https://gitlab.com/components/opentofu/-/releases to obtain the image digests.'
 
     # Configuration
-- 
GitLab