ingress_class: Optional[str]
ingress_whitelist_source_range: Optional[str]
tls_secret_name: Optional[str]
+ image_pull_policy: Optional[str]
@validator("port")
def validate_port(cls, v):
ip_network(v)
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 NgUiCharm(CharmedOsmBase):
def __init__(self, *args) -> NoReturn:
# Create Builder for the PodSpec
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=config.port)
container = container_builder.build()
container_builder.add_tcpsocket_readiness_probe(