Comments (1)
To implement this, we'd need something like:
# Note: get_layer is no longer decorated with @abstractmethod, so that someone doesn't need to subclass things at all
def get_layer(self) -> List[Layer]:
"""Pebble configuration layer for the container.
Override this method with your own layer configuration.
"""
return []
def _update_layer(self):
"""Updates the Pebble layer for this component, re-planning the services afterward."""
container = self._charm.unit.get_container(self.container_name)
new_layers = self.get_layer()
# For backward compatibility, handle when self.get_layer() returns a single Layer
if not isinstance(new_layers, Iterable):
new_layers = [new_layers]
original_plan = container.get_plan()
for new_layer in new_layers:
container.add_layer(new_layer)
if original_plan.services != container.get_plan():
container.replan()
where we handle the old version of get_layer()
returning a single layer, and loop through the layers then decide at the end of a replan is needed
from charmed-kubeflow-chisme.
Related Issues (20)
- Add helper function to test grafana-dashboard relation HOT 1
- O11y testing abstraction is broken HOT 4
- Cos abstraction should use Grafana agent API to verify metrics targets HOT 1
- [cos integration] Provide relation endpoint as function argument HOT 1
- assert_grafana_dashboards failed for local charms HOT 2
- Get relation data from provides or required side of relation HOT 1
- [cos integration] function deploy_and_assert_grafana_agent should be used with more apps HOT 2
- Typo in error message for `update_layer`
- refactor `apply_many` and `delete_many` so they (optionally?) do not fail fast when hitting an error HOT 1
- add a `block_until_ready` to Kubernetes actions like apply or maybe delete
- _get_missing_kubernetes_resources() will not validate applied namespaced k8s resources without a namespace
- Publish a new release HOT 1
- base charm: Enhance the pebble component to accept the contents of a file HOT 1
- Add a feature to `KubernetesResourceHandler` to reuse Jinja templates HOT 1
- Implement functionality for custom images for air gap deployment HOT 2
- How to add functions that need charm libraries to chisme? HOT 3
- Implement abstraction of observability module with function returning MetricsEndpointProvider HOT 2
- Abstraction for cos integration tests HOT 1
- Abstraction for testing the logging relation with grafana-agent-k8s HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from charmed-kubeflow-chisme.