Skip to content

Commit 6eebf02

Browse files
fix: too permissive sed regex
1 parent f2cbcea commit 6eebf02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

roles/app-installer/tasks/install_app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@
102102
s|image: (docker.io\/)?([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\2\3\4|
103103
b
104104
}
105-
/image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?/ {
106-
s|image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
105+
/^image: [a-z0-9\-]+\/[a-z0-9\-]+(:[^@ ]+)?(@sha256:[a-f0-9]{64})?$/ {
106+
s|^image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
107107
b
108108
}
109-
/image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?/ {
110-
s|image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
109+
/^image: [a-z0-9\-]+(:[^@ ]+)?(@sha256:[a-f0-9]{64})?$/ {
110+
s|^image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
111111
}
112112
}' \
113113
| yq eval 'select(.kind == "Pod") |= .spec.imagePullSecrets += [{"name": "harbor-pull-secret"}] |

0 commit comments

Comments
 (0)