Skip to content

Commit 88f4273

Browse files
committed
feat: Support templating the namespace
1 parent 70049ca commit 88f4273

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

rust/stackable-cockpit/src/platform/manifests.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ pub trait InstallManifestsExt {
7474
) -> Result<(), Error> {
7575
debug!("Installing demo / stack manifests");
7676

77+
let mut parameters = parameters.clone();
78+
// We add the NAMESPACE parameter, so that stacks/demos can use that to render e.g. the
79+
// fqdn service names [which contain the namespace].
80+
parameters.insert("NAMESPACE".to_owned(), product_namespace.to_owned());
81+
7782
for manifest in manifests {
7883
match manifest {
7984
ManifestSpec::HelmChart(helm_file) => {
@@ -85,7 +90,7 @@ pub trait InstallManifestsExt {
8590
})?;
8691

8792
let helm_chart: helm::Chart = transfer_client
88-
.get(&helm_file, &Template::new(parameters).then(Yaml::new()))
93+
.get(&helm_file, &Template::new(&parameters).then(Yaml::new()))
8994
.await
9095
.context(FileTransferSnafu)?;
9196

@@ -133,7 +138,7 @@ pub trait InstallManifestsExt {
133138
})?;
134139

135140
let manifests = transfer_client
136-
.get(&path_or_url, &Template::new(parameters))
141+
.get(&path_or_url, &Template::new(&parameters))
137142
.await
138143
.context(FileTransferSnafu)?;
139144

rust/stackablectl/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Pass the namespace as argument `NAMESPACE` to templates files.
10+
This should unblock demos to run in all namespaces, as they can template the namespace e.g. for the fqdn of services.
11+
712
### Fixes
813

914
- Use `rustls-native-certs` so that `stackablectl` can be used in environments with internal PKI ([#351]).

0 commit comments

Comments
 (0)