Load resource definitions from prepared files (data fixtures)#34
Merged
Conversation
430d5cf to
cb5e368
Compare
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>
6d450b4 to
5938639
Compare
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>
5938639 to
e3e99cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/v2Bundle the builtin resources in the package for simplicity.
Closes #26