projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correcting osm-nglcm charm configuration file name.
[osm/devops.git]
/
installers
/
charm
/
ng-ui
/
src
/
charm.py
diff --git
a/installers/charm/ng-ui/src/charm.py
b/installers/charm/ng-ui/src/charm.py
index
cf0b091
..
39675d0
100755
(executable)
--- a/
installers/charm/ng-ui/src/charm.py
+++ b/
installers/charm/ng-ui/src/charm.py
@@
-54,7
+54,8
@@
class ConfigModel(ModelValidator):
ingress_class: Optional[str]
ingress_whitelist_source_range: Optional[str]
tls_secret_name: Optional[str]
ingress_class: Optional[str]
ingress_whitelist_source_range: Optional[str]
tls_secret_name: Optional[str]
- image_pull_policy: Optional[str]
+ image_pull_policy: str
+ security_context: bool
@validator("port")
def validate_port(cls, v):
@validator("port")
def validate_port(cls, v):
@@
-116,7
+117,7
@@
class NgUiCharm(CharmedOsmBase):
files_builder = FilesV3Builder()
files_builder.add_file(
"default",
files_builder = FilesV3Builder()
files_builder.add_file(
"default",
- Template(Path("
files/default
").read_text()).substitute(
+ Template(Path("
templates/default.template
").read_text()).substitute(
port=config.port,
server_name=config.server_name,
max_file_size=config.max_file_size,
port=config.port,
server_name=config.server_name,
max_file_size=config.max_file_size,
@@
-132,10
+133,15
@@
class NgUiCharm(CharmedOsmBase):
# Check relations
self._check_missing_dependencies(config)
# Create Builder for the PodSpec
# Check relations
self._check_missing_dependencies(config)
# Create Builder for the PodSpec
- pod_spec_builder = PodSpecV3Builder()
+ pod_spec_builder = PodSpecV3Builder(
+ enable_security_context=config.security_context
+ )
# Build Container
container_builder = ContainerV3Builder(
# Build Container
container_builder = ContainerV3Builder(
- self.app.name, image_info, config.image_pull_policy
+ self.app.name,
+ image_info,
+ config.image_pull_policy,
+ run_as_non_root=config.security_context,
)
container_builder.add_port(name=self.app.name, port=config.port)
container = container_builder.build()
)
container_builder.add_port(name=self.app.name, port=config.port)
container = container_builder.build()