Skip to content

Load resource definitions from prepared files (data fixtures)#34

Merged
nolar merged 4 commits intomainfrom
resource-info-files
Apr 3, 2026
Merged

Load resource definitions from prepared files (data fixtures)#34
nolar merged 4 commits intomainfrom
resource-info-files

Conversation

@nolar
Copy link
Copy Markdown
Owner

@nolar nolar commented Apr 2, 2026

Provide a CLI tool to fetch the resource definitions from a cluster and dump it to a file.

kmock fetch resources -o resources.gz  # k8s basics only
kmock fetch resources -o resources.gz -i kopf.dev -x kopf.dev/v2
kmock fetch resources -o resources.gz --include=kopf.dev --exclude=kopf.dev/v2

Bundle the builtin resources in the package for simplicity.

kmock.resources.load_bundled()
kmock.resources.load_file('./resources.gz')
kmock.resources.load_data(gzip.decompress(importlib.resources.read_binary('mypkg', 'resources.gz')))

Closes #26

@nolar nolar added the enhancement New feature or request label Apr 2, 2026
@nolar nolar force-pushed the resource-info-files branch 6 times, most recently from 430d5cf to cb5e368 Compare April 3, 2026 16:51
@nolar nolar marked this pull request as ready for review April 3, 2026 16:51
nolar and others added 3 commits April 3, 2026 19:14
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
There is also a property `resources` in `KubernetesScaffold`, so it might collide with the module name if it is imported there. The property is more important — it is the public interface, must be convenient and intuitive. The module is internal and can be renamed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
In the following commit, it will be used for resources preloading.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar force-pushed the resource-info-files branch 3 times, most recently from 6d450b4 to 5938639 Compare April 3, 2026 18:00
Provide a CLI tool to fetch the resource definitions from a cluster and dump it to a file.

```bash
kmock fetch resources -o resources.gz  # k8s basics only
kmock fetch resources -o resources.bz2 -i kopf.dev -x kopf.dev/v2
kmock fetch resources -o resources.zst --include=kopf.dev --exclude=kopf.dev/v2
```

Bundle the builtin resources in the package for simplicity.

```
kmock.resources.load_bundled()
kmock.resources.load_file('./resources.gz')
kmock.resources.load_data(gzip.decompress(importlib.resources.read_binary('mypkg', 'resources.gz')))
```

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar force-pushed the resource-info-files branch from 5938639 to e3e99cc Compare April 3, 2026 18:24
@nolar nolar merged commit 7e5aaad into main Apr 3, 2026
12 checks passed
@nolar nolar deleted the resource-info-files branch April 3, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prepopulated list of resources for discovery and objects for usage

1 participant