@@ -5,7 +5,9 @@ use snafu::{ensure, ResultExt, Snafu};
55use tracing:: { info, instrument} ;
66
77use crate :: {
8- constants:: { HELM_REPO_NAME_DEV , HELM_REPO_NAME_STABLE , HELM_REPO_NAME_TEST } ,
8+ constants:: {
9+ HELM_OCI_REGISTRY , HELM_REPO_NAME_DEV , HELM_REPO_NAME_STABLE , HELM_REPO_NAME_TEST ,
10+ } ,
911 helm,
1012 utils:: operator_chart_name,
1113} ;
@@ -176,20 +178,25 @@ impl OperatorSpec {
176178
177179 /// Installs the operator using Helm.
178180 #[ instrument( skip_all) ]
179- pub fn install ( & self , namespace : & str ) -> Result < ( ) , helm:: Error > {
181+ pub fn install ( & self , namespace : & str , use_registry : bool ) -> Result < ( ) , helm:: Error > {
180182 info ! ( "Installing operator {}" , self ) ;
181183
182184 let version = self . version . as_ref ( ) . map ( |v| v. to_string ( ) ) ;
183- let helm_repo = self . helm_repo_name ( ) ;
184185 let helm_name = self . helm_name ( ) ;
185186
187+ let chart_source = if use_registry {
188+ HELM_OCI_REGISTRY . to_string ( )
189+ } else {
190+ self . helm_repo_name ( )
191+ } ;
192+
186193 // Install using Helm
187- helm:: install_release_from_repo (
194+ helm:: install_release_from_repo_or_registry (
188195 & helm_name,
189196 helm:: ChartVersion {
190197 chart_version : version. as_deref ( ) ,
191198 chart_name : & helm_name,
192- repo_name : & helm_repo ,
199+ chart_source : & chart_source ,
193200 } ,
194201 None ,
195202 namespace,
0 commit comments