Versioned kpack models for cloudcoil
Project description
cloudcoil-models-kpack
Versioned kpack models for cloudcoil.
[!WARNING]
This repository is auto-generated from the cloudcoil repository. Please do not submit pull requests here. Instead, submit them to the main repository at https://github.com/cloudcoil/cloudcoil.
🔧 Installation
[!NOTE] For versioning information and compatibility, see the Versioning Guide.
Using uv (recommended):
# Install with kpack support
uv add cloudcoil.models.kpack
Using pip:
pip install cloudcoil.models.kpack
💡 Examples
Using kpack Models
from cloudcoil import apimachinery
import cloudcoil.models.kpack.v1alpha2 as kpack
import cloudcoil.models.kpack.core as core
import cloudcoil.models.kubernetes.core.v1 as k8score
# Create an Image resource
image = kpack.Image(
metadata=apimachinery.ObjectMeta(name="my-app"),
spec=kpack.ImageSpec(
tag="registry.example.com/my-app",
builder_=k8score.ObjectReference(
name="my-builder",
kind="ClusterBuilder"
),
source=core.SourceConfig(
git=core.Git(
url="https://github.com/my-org/my-app.git",
revision="main"
)
)
)
).create()
# Create a Builder
builder = kpack.BuilderResource(
metadata=apimachinery.ObjectMeta(name="my-builder"),
spec=kpack.BuilderSpec(
tag="registry.example.com/builder",
stack=k8score.ObjectReference(
name="base",
kind="ClusterStack"
),
store=k8score.ObjectReference(
name="default",
kind="ClusterStore"
)
)
).create()
# List Images
for img in kpack.Image.list():
print(f"Found image: {img.metadata.name}")
# Update an Image
image.spec.source.git.revision = "v1.0.0"
image.save()
# Delete resources
kpack.Image.delete("my-app")
kpack.BuilderResource.delete("my-builder")
Using the Fluent Builder API
from cloudcoil.models.kpack.v1alpha2 import Image
# Create an Image using the fluent builder
image = (
Image.builder()
.metadata(lambda m: m
.name("my-app")
.namespace("default")
)
.spec(lambda s: s
.tag("registry.example.com/my-app")
.builder_(lambda b: b
.name("my-builder")
.kind("ClusterBuilder")
)
.source(lambda src: src
.git(lambda g: g
.url("https://github.com/my-org/my-app.git")
.revision("main")
)
)
)
.build()
)
Using the Context Manager Builder API
from cloudcoil.models.kpack.v1alpha2 import Image, BuilderResource
# Create an image using context managers
with Image.new() as app_image:
with app_image.metadata() as metadata:
metadata.name("my-app")
metadata.namespace("default")
with app_image.spec() as spec:
spec.tag("registry.example.com/my-app")
with spec.builder_() as builder:
builder.name("my-builder")
builder.kind("ClusterBuilder")
with spec.source() as source:
with source.git() as git:
git.url("https://github.com/my-org/my-app.git")
git.revision("main")
final_image = app_image.build()
# Create a builder using context managers
with BuilderResource.new() as builder:
with builder.metadata() as metadata:
metadata.name("my-builder")
metadata.namespace("default")
with builder.spec() as spec:
spec.tag("registry.example.com/builder")
with spec.stack() as stack:
stack.name("base")
stack.kind("ClusterStack")
with spec.store() as store:
store.name("default")
store.kind("ClusterStore")
# Add buildpacks to the builder
with spec.buildpacks() as buildpacks:
with buildpacks.add() as pack:
pack.id("paketo-buildpacks/java")
pack.version("3.0.0")
final_builder = builder.build()
The context manager builder provides:
- 🎭 Clear visual nesting of resource structure
- 🔒 Automatic resource cleanup
- 🎯 Familiar Python context manager pattern
- ✨ Same great IDE support as the fluent builder
📚 Documentation
For complete documentation, visit cloudcoil.github.io/cloudcoil
📜 License
Apache License, Version 2.0 - see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudcoil_models_kpack-0.16.1.0.tar.gz.
File metadata
- Download URL: cloudcoil_models_kpack-0.16.1.0.tar.gz
- Upload date:
- Size: 94.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b15a7428bc451dd4ec7761e4844f904be04051d26e6ba830d22333bae9b5bc24
|
|
| MD5 |
8512781b2d5b67c25d4597745d2e5f09
|
|
| BLAKE2b-256 |
c864901a905d52501cdd3d015887dcfe40ae8763f9253b6e9d257b27c88ffe44
|
Provenance
The following attestation bundles were made for cloudcoil_models_kpack-0.16.1.0.tar.gz:
Publisher:
pypi_publish.yml on cloudcoil/models-kpack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudcoil_models_kpack-0.16.1.0.tar.gz -
Subject digest:
b15a7428bc451dd4ec7761e4844f904be04051d26e6ba830d22333bae9b5bc24 - Sigstore transparency entry: 168064150
- Sigstore integration time:
-
Permalink:
cloudcoil/models-kpack@9bf3f8d9083872102e429f7af4727f15b12ee5b6 -
Branch / Tag:
refs/tags/0.16.1.0 - Owner: https://github.com/cloudcoil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_publish.yml@9bf3f8d9083872102e429f7af4727f15b12ee5b6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cloudcoil_models_kpack-0.16.1.0-py3-none-any.whl.
File metadata
- Download URL: cloudcoil_models_kpack-0.16.1.0-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d0c1711930fc32ad5de92e0bc5d7cc423eeedabd7c775ab81305b1b5735f4bf
|
|
| MD5 |
8f1601660daba7d7cf9b30299b372bd3
|
|
| BLAKE2b-256 |
21987454efa29519cd542d5e6f4017ec58b09f0e2b0937dc0b214ea6ab3fc38d
|
Provenance
The following attestation bundles were made for cloudcoil_models_kpack-0.16.1.0-py3-none-any.whl:
Publisher:
pypi_publish.yml on cloudcoil/models-kpack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudcoil_models_kpack-0.16.1.0-py3-none-any.whl -
Subject digest:
1d0c1711930fc32ad5de92e0bc5d7cc423eeedabd7c775ab81305b1b5735f4bf - Sigstore transparency entry: 168064151
- Sigstore integration time:
-
Permalink:
cloudcoil/models-kpack@9bf3f8d9083872102e429f7af4727f15b12ee5b6 -
Branch / Tag:
refs/tags/0.16.1.0 - Owner: https://github.com/cloudcoil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_publish.yml@9bf3f8d9083872102e429f7af4727f15b12ee5b6 -
Trigger Event:
release
-
Statement type: