Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/features_parse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ outputs:
runs:
using: composite
steps:
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/[email protected].8
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/[email protected].9
- id: result
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/flavors_parse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ outputs:
runs:
using: composite
steps:
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/[email protected].8
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/[email protected].9
- id: matrix
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Installs the given GardenLinux Python library
inputs:
version:
description: GardenLinux Python library version
default: "0.10.8"
default: "0.10.9"
python_version:
description: Python version to setup
default: "3.13"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gardenlinux"
version = "0.10.8"
version = "0.10.9"
description = "Contains tools to work with the features directory of gardenlinux, for example deducting dependencies from feature sets or validating cnames"
authors = ["Garden Linux Maintainers <[email protected]>"]
license = "Apache-2.0"
Expand Down
141 changes: 81 additions & 60 deletions src/gardenlinux/oci/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,85 @@ def cli() -> None:
pass


@cli.command()
@click.option(
"--index",
required=True,
help="OCI image index",
)
@click.option(
"--index-tag",
required=True,
help="OCI image index tag",
)
@click.option(
"--manifest_folder",
default="manifests",
help="A folder where the index entries are read from.",
)
@click.option(
"--insecure",
default=False,
help="Use HTTP to communicate with the registry",
)
@click.option(
"--additional_tag",
required=False,
multiple=True,
help="Additional tag to push the index with",
)
def push_index_from_directory(
index: str,
index_tag: str,
manifest_folder: str,
insecure: bool,
additional_tag: List[str],
) -> None:
"""
Push a list of files from the `manifest_folder` to an index.

:since: 0.10.9
"""

index = Container(f"{index}:{index_tag}", insecure=insecure)
index.push_index_from_directory(manifest_folder, additional_tag)


@cli.command()
@click.option(
"--index",
required=True,
help="OCI image index",
)
@click.option(
"--index-tag",
required=True,
help="OCI image index tag",
)
@click.option(
"--insecure",
default=False,
help="Use HTTP to communicate with the registry",
)
@click.option(
"--tag",
required=True,
multiple=True,
help="Tag to push the OCI image index with",
)
def push_index_tags(index: str, index_tag: str, insecure: bool, tag: List[str]) -> None:
"""
Push OCI image index tags to a registry.

:since: 0.10.9
"""

index = Container(f"{index}:{index_tag}", insecure=insecure)

image_index = index.read_or_generate_index()
index.push_index_for_tags(image_index, tag)


@cli.command()
@click.option(
"--container",
Expand Down Expand Up @@ -94,10 +173,7 @@ def push_manifest(
:since: 0.7.0
"""

container = Container(
f"{container}:{version}",
insecure=insecure,
)
container = Container(f"{container}:{version}", insecure=insecure)

manifest = container.read_or_generate_manifest(cname, arch, version, commit)

Expand Down Expand Up @@ -173,67 +249,12 @@ def push_manifest_tags(
:since: 0.10.0
"""

container = Container(
f"{container}:{version}",
insecure=insecure,
)
container = Container(f"{container}:{version}", insecure=insecure)

manifest = container.read_or_generate_manifest(cname, arch, version, commit)
container.push_manifest_for_tags(manifest, tag)


@cli.command()
@click.option(
"--container",
"container",
required=True,
type=click.Path(),
help="Container Name",
)
@click.option(
"--version",
"version",
required=True,
type=click.Path(),
help="Version of image",
)
@click.option(
"--manifest_folder",
default="manifests",
help="A folder where the index entries are read from.",
)
@click.option(
"--insecure",
default=False,
help="Use HTTP to communicate with the registry",
)
@click.option(
"--additional_tag",
required=False,
multiple=True,
help="Additional tag to push the index with",
)
def update_index(
container: str,
version: str,
manifest_folder: str,
insecure: bool,
additional_tag: List[str],
) -> None:
"""
Push a list of files from the `manifest_folder` to an index.

:since: 0.7.0
"""

container = Container(
f"{container}:{version}",
insecure=insecure,
)

container.push_index_from_directory(manifest_folder, additional_tag)


def main() -> None:
"""
gl-oci main()
Expand Down
6 changes: 3 additions & 3 deletions tests/oci/test_oci.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def update_index(
print("Updating index")

cmd = [
"update-index",
"--container",
"push-index-from-directory",
"--index",
CONTAINER_NAME_ZOT_EXAMPLE,
"--version",
"--index-tag",
version,
"--insecure",
"True",
Expand Down
Loading