Skip to content

Commit

Permalink
hack registry to fix catalogsource
Browse files Browse the repository at this point in the history
  • Loading branch information
eg-ayoub committed Dec 27, 2024
1 parent 762ad5e commit 945162e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
22 changes: 22 additions & 0 deletions buildchain/static-container-registry/static-container-registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def create_config(
types {{ }} default_type "application/json";
return 200 '{payload:s}';
}}
location = /v2/{name:s}/tags/list {{
types {{ }} default_type "application/json";
return 200 '{payload:s}';
}}
""".format(
name=name,
name_prefix=name_prefix.lstrip("/"),
Expand Down Expand Up @@ -145,6 +149,13 @@ def create_config(
try_files manifest.json =404;
error_page 404 @404_tag;
}}
location = "/v2/{name:s}/manifests/{tag:s}" {{
alias {server_root:s}/{name:s}/{tag:s}/;
types {{ }} default_type "application/vnd.docker.distribution.manifest.v2+json";
add_header 'Docker-Content-Digest' 'sha256:{digest:s}';
try_files manifest.json =404;
error_page 404 @404_tag;
}}
""".format(
name=name,
tag=tag,
Expand All @@ -162,6 +173,13 @@ def create_config(
try_files manifest.json =404;
error_page 404 @404_tag;
}}
location = "/v2/{name:s}/manifests/sha256:{digest:s}" {{
alias {server_root:s}/{name:s}/{tag:s}/;
types {{ }} default_type "application/vnd.docker.distribution.manifest.v2+json";
add_header 'Docker-Content-Digest' 'sha256:{digest:s}';
try_files manifest.json =404;
error_page 404 @404_tag;
}}
""".format(
name=name,
tag=tag,
Expand All @@ -184,6 +202,10 @@ def create_config(
alias {server_root:s}/{name:s}/;
try_files {paths:s} =404;
}}
location ~ "/v2/{name:s}/blobs/sha256:([a-f0-9]{{64}})" {{
alias {server_root:s}/{name:s}/;
try_files {paths:s} =404;
}}
""".format(
name_prefix=name_prefix.lstrip("/"),
server_root=server_root,
Expand Down
13 changes: 13 additions & 0 deletions salt/metalk8s/addons/olm/catalog/deployed/cluster-catalog.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!jinja | metalk8s_kubernetes
{%- from "metalk8s/repo/macro.sls" import build_image_name with context %}
---
apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
Expand All @@ -10,3 +12,14 @@ spec:
image:
ref: quay.io/operatorhubio/catalog:latest
pollIntervalMinutes: 10
---
apiVersion: olm.operatorframework.io/v1
kind: ClusterCatalog
metadata:
name: metalk8s-catalog-source
spec:
source:
type: Image
image:
ref: {{ build_image_name("metalk8s-catalog-source") }}
pollIntervalMinutes: 10
3 changes: 3 additions & 0 deletions salt/metalk8s/container-engine/containerd/installed.sls
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ Configure registry IP in containerd conf:
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."{{ repo.registry_endpoint }}"]
endpoint = [{{ registry_eps | join(",") }}]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.metalk8s.lan"]
endpoint = [{{ registry_eps | join(",") }}]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
Expand Down

0 comments on commit 945162e

Please sign in to comment.