fn make_template_context(&self, reg: &Region) -> Result<Context> {
        // same context as normal templates + base_urls
        let mut ctx = Context::new();

        // not great: pass env & secrets in a single btree for backwards compatibility
        // TODO: switch to a bespoke `secrets` struct in manifests
        let mut full_env = self.env.plain.clone();
        full_env.append(&mut self.secrets.clone());

        ctx.insert("env", &full_env);
        ctx.insert("service", &self.name.clone());
        ctx.insert("environment", &reg.environment.to_string());
        ctx.insert("region", &reg.name.clone());
        ctx.insert("kafka", &self.kafka.clone());
        ctx.insert("base_urls", &reg.base_urls);
        ctx.insert("kong", &reg.kong);
        ctx.insert("cluster", &reg.cluster.clone());
        ctx.insert("namespace", &reg.namespace.clone());
        Ok(ctx)
    }
// This function defines what variables are available within .j2 templates and evars
This function defines what variables are available within .j2 templates and evars
This function defines what variables are available within . j2 templates and evars
fn make_template_context(&self, reg: &Region) -> Result<Context> {
        // same context as normal templates + base_urls
        let mut ctx = Context::new();
        // not great: pass env & secrets in a single btree for backwards compatibility
        // TODO: switch to a bespoke `secrets` struct in manifests
        let mut full_env = self.env.plain.clone();
        full_env.append(&mut self.secrets.clone());
        ctx.insert("env", &full_env);
        ctx.insert("service", &self.name.clone());
        ctx.insert("environment", &reg.environment.to_string());
        ctx.insert("region", &reg.name.clone());
        ctx.insert("kafka", &self.kafka.clone());
        ctx.insert("base_urls", &reg.base_urls);
        ctx.insert("kong", &reg.kong);
        ctx.insert("cluster", &reg.cluster.clone());
        ctx.insert("namespace", &reg.namespace.clone());
        Ok(ctx)
    }
fn make_template_context ( & self , reg : & Region ) -> Result < Context > { // same context as normal templates + base_urls let mut ctx = Context :: new ( ) ; // not great: pass env & secrets in a single btree for backwards compatibility // TODO: switch to a bespoke `secrets` struct in manifests let mut full_env = self . env . plain . clone ( ) ; full_env . append ( & mut self . secrets . clone ( ) ) ; ctx . insert ( " " , & full_env ) ; ctx . insert ( " " , & self . name . clone ( ) ) ; ctx . insert ( " " , & reg . environment . to_string ( ) ) ; ctx . insert ( " " , & reg . name . clone ( ) ) ; ctx . insert ( " " , & self . kafka . clone ( ) ) ; ctx . insert ( " " , & reg . base_urls ) ; ctx . insert ( " " , & reg . kong ) ; ctx . insert ( " " , & reg . cluster . clone ( ) ) ; ctx . insert ( " " , & reg . namespace . clone ( ) ) ; Ok ( ctx ) }
This function defines what variables are available within .j2 templates and evars
This function defines what variables are available within . j2 templates and evars
&self
reg
&Region
&self
reg
&Region