MCPcopy Create free account
hub / github.com/Qovery/engine / new

Method new

lib-engine/src/environment/models/helm_chart.rs:63–139  ·  view source on GitHub ↗
(
        context: &Context,
        long_id: Uuid,
        name: String,
        kube_name: String,
        action: Action,
        mut chart_source: HelmChartSource,
        mut chart_values: HelmVa

Source from the content-addressed store, hash-verified

61// Here we define the common behavior among all providers
62impl<T: CloudProvider> HelmChart<T> {
63 pub fn new(
64 context: &Context,
65 long_id: Uuid,
66 name: String,
67 kube_name: String,
68 action: Action,
69 mut chart_source: HelmChartSource,
70 mut chart_values: HelmValueSource,
71 set_values: Vec<(String, String)>,
72 set_string_values: Vec<(String, String)>,
73 set_json_values: Vec<(String, String)>,
74 command_args: Vec<String>,
75 timeout: Duration,
76 allow_cluster_wide_resources: bool,
77 environment_variables: HashMap<String, VariableInfo>,
78 external_secrets: BTreeMap<String, ExternalSecret>,
79 advanced_settings: HelmChartAdvancedSettings,
80 extra_settings: T::AppExtraSettings,
81 mk_event_details: impl Fn(Transmitter) -> EventDetails,
82 ports: Vec<Port>,
83 ) -> Result<Self, HelmChartError> {
84 let workspace_directory = crate::fs::workspace_directory(
85 context.workspace_root_dir(),
86 context.execution_id(),
87 format!("helm_charts/{long_id}"),
88 )
89 .map_err(|_| HelmChartError::InvalidConfig("Can't create workspace directory".to_string()))?;
90
91 // Normalize paths to be relative paths in order to concat them easily
92 match &mut chart_source {
93 HelmChartSource::Repository { .. } => {}
94 HelmChartSource::Git { root_path, .. } => {
95 if root_path.is_absolute() {
96 *root_path = to_relative_path(root_path)?;
97 }
98 }
99 }
100
101 match &mut chart_values {
102 HelmValueSource::Raw { .. } => {}
103 HelmValueSource::Git { values_path, .. } => {
104 for path in values_path {
105 *path = to_relative_path(path)?;
106 }
107 }
108 }
109
110 let external_secrets = build_external_secret_groups(&kube_name, external_secrets);
111 let event_details = mk_event_details(Transmitter::Helm(long_id, name.to_string()));
112 let mk_event_details = move |stage: Stage| EventDetails::clone_changing_stage(event_details.clone(), stage);
113 Ok(Self {
114 _marker: PhantomData,
115 mk_event_details: Box::new(mk_event_details),
116 id: to_short_id(&long_id),
117 long_id,
118 action,
119 name,
120 kube_name,

Callers

nothing calls this directly

Calls 9

workspace_directoryFunction · 0.85
to_relative_pathFunction · 0.85
HelmClass · 0.85
to_short_idFunction · 0.85
workspace_root_dirMethod · 0.80
lib_root_dirMethod · 0.80
execution_idMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected