Skip to content

Commit 0f23589

Browse files
authored
ci: add kustomization for image catalogs (#310)
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 37c48d4 commit 0f23589

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/catalogs_generator.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,19 @@ def write_catalog(tags, version_re, img_type, os_name, output_dir="."):
154154
repo_json = get_json(full_repo_name)
155155
tags = repo_json["Tags"]
156156

157+
catalogs = []
157158
for img_type in supported_img_types:
158159
for os_name in supported_os_names:
159-
print(f"Generating catalog-{img_type}-{os_name}.yaml")
160+
filename = f"catalog-{img_type}-{os_name}.yaml"
161+
print(f"Generating {filename}")
160162
write_catalog(tags, pg_regexp, img_type, os_name, args.output_dir)
163+
catalogs.append(filename)
164+
165+
kustomization = {
166+
"apiVersion": "kustomize.config.k8s.io/v1beta1",
167+
"kind": "Kustomization",
168+
"resources": sorted(catalogs),
169+
}
170+
kustomization_file = os.path.join(args.output_dir, "kustomization.yaml")
171+
with open(kustomization_file, "w") as f:
172+
yaml.dump(kustomization, f, sort_keys=False)

0 commit comments

Comments
 (0)