ingress_whitelist_source_range: Optional[str]
tls_secret_name: Optional[str]
mysql_uri: Optional[str]
+ image_pull_policy: Optional[str]
@validator("site_url")
def validate_site_url(cls, v):
raise ValueError("mysql_uri is not properly formed")
return v
+ @validator("image_pull_policy")
+ def validate_image_pull_policy(cls, v):
+ values = {
+ "always": "Always",
+ "ifnotpresent": "IfNotPresent",
+ "never": "Never",
+ }
+ v = v.lower()
+ if v not in values.keys():
+ raise ValueError("value must be always, ifnotpresent or never")
+ return values[v]
+
class MysqlExporterCharm(CharmedOsmBase):
def __init__(self, *args) -> NoReturn:
pod_spec_builder = PodSpecV3Builder()
# Build container
- container_builder = ContainerV3Builder(self.app.name, image_info)
+ container_builder = ContainerV3Builder(
+ self.app.name, image_info, config.image_pull_policy
+ )
container_builder.add_port(name=self.app.name, port=PORT)
container_builder.add_http_readiness_probe(
path="/api/health",