(
context: &Context,
long_id: Uuid,
action: Action,
name: &str,
kube_name: String,
public_domain: String,
ports: Vec<Port>,
min_instance
| 90 | impl<T: CloudProvider> Application<T> { |
| 91 | #[allow(clippy::too_many_arguments)] |
| 92 | pub fn new( |
| 93 | context: &Context, |
| 94 | long_id: Uuid, |
| 95 | action: Action, |
| 96 | name: &str, |
| 97 | kube_name: String, |
| 98 | public_domain: String, |
| 99 | ports: Vec<Port>, |
| 100 | min_instances: u32, |
| 101 | max_instances: u32, |
| 102 | build: Build, |
| 103 | command_args: Vec<String>, |
| 104 | entrypoint: Option<String>, |
| 105 | storages: Vec<Storage>, |
| 106 | environment_variables: Vec<EnvironmentVariable>, |
| 107 | external_secrets: BTreeMap<String, ExternalSecret>, |
| 108 | mounted_files: BTreeSet<MountedFile>, |
| 109 | readiness_probe: Option<Probe>, |
| 110 | liveness_probe: Option<Probe>, |
| 111 | advanced_settings: ApplicationAdvancedSettings, |
| 112 | extra_settings: T::AppExtraSettings, |
| 113 | mk_event_details: impl Fn(Transmitter) -> EventDetails, |
| 114 | annotations_groups: Vec<AnnotationsGroup>, |
| 115 | labels_groups: Vec<LabelsGroup>, |
| 116 | cpu_request: KubernetesCpuResourceUnit, |
| 117 | cpu_limit: KubernetesCpuResourceUnit, |
| 118 | ram_request: KubernetesMemoryResourceUnit, |
| 119 | ram_limit: KubernetesMemoryResourceUnit, |
| 120 | gpu_request: Option<KubernetesGpuResourceUnit>, |
| 121 | gpu_limit: Option<KubernetesGpuResourceUnit>, |
| 122 | ephemeral_storage_in_gib: Option<u32>, |
| 123 | should_delete_shared_registry: bool, |
| 124 | autoscaling: Option<AutoscalingConfig>, |
| 125 | cpu_architecture: Option<CpuArchitecture>, |
| 126 | ) -> Result<Self, ApplicationError> { |
| 127 | // TODO: Check that the information provided are coherent |
| 128 | |
| 129 | let workspace_directory = crate::fs::workspace_directory( |
| 130 | context.workspace_root_dir(), |
| 131 | context.execution_id(), |
| 132 | format!("applications/{long_id}"), |
| 133 | ) |
| 134 | .map_err(|_| ApplicationError::InvalidConfig("Can't create workspace directory".to_string()))?; |
| 135 | |
| 136 | let event_details = mk_event_details(Transmitter::Application(long_id, name.to_string())); |
| 137 | let mk_event_details = move |stage: Stage| EventDetails::clone_changing_stage(event_details.clone(), stage); |
| 138 | let external_secrets = build_external_secret_groups(&kube_name, external_secrets); |
| 139 | |
| 140 | Ok(Self { |
| 141 | _marker: PhantomData, |
| 142 | mk_event_details: Box::new(mk_event_details), |
| 143 | id: to_short_id(&long_id), |
| 144 | long_id, |
| 145 | action, |
| 146 | name: name.to_string(), |
| 147 | kube_name, |
| 148 | public_domain, |
| 149 | ports, |
nothing calls this directly
no test coverage detected