@@ -32,13 +32,15 @@ type DeploymentSubroutine struct {
3232 client client.Client
3333 cfg * pmconfig.CommonServiceConfig
3434 workspaceDirectory string
35+ cfgOperator * config.OperatorConfig
3536}
3637
3738func NewDeploymentSubroutine (client client.Client , cfg * pmconfig.CommonServiceConfig , operatorCfg * config.OperatorConfig ) * DeploymentSubroutine {
3839 sub := & DeploymentSubroutine {
3940 cfg : cfg ,
4041 client : client ,
4142 workspaceDirectory : filepath .Join (operatorCfg .WorkspaceDir , "/manifests/k8s/" ),
43+ cfgOperator : operatorCfg ,
4244 }
4345
4446 return sub
@@ -58,7 +60,7 @@ func (r *DeploymentSubroutine) Finalizers() []string { // coverage-ignore
5860
5961func (r * DeploymentSubroutine ) Process (ctx context.Context , runtimeObj runtimeobject.RuntimeObject ) (ctrl.Result , errors.OperatorError ) {
6062 inst := runtimeObj .(* v1alpha1.PlatformMesh )
61- log := logger .LoadLoggerFromContext (ctx )
63+ log := logger .LoadLoggerFromContext (ctx ). ChildLogger ( "subroutine" , r . GetName ())
6264 operatorCfg := pmconfig .LoadConfigFromContext (ctx ).(config.OperatorConfig )
6365
6466 // Create DeploymentComponents Version
@@ -113,23 +115,24 @@ func (r *DeploymentSubroutine) Process(ctx context.Context, runtimeObj runtimeob
113115 return ctrl.Result {}, oErr
114116 }
115117
116- // Wait for istiod release to be ready before continuing
117- rel , err := getHelmRelease (ctx , r .client , "istio-istiod" , "default" )
118- if err != nil {
119- log .Error ().Err (err ).Msg ("Failed to get istio-istiod Release" )
120- return ctrl.Result {}, errors .NewOperatorError (err , false , true )
121- }
122-
123- if ! MatchesCondition (rel , "Ready" ) {
124- log .Info ().Msg ("istio-istiod Release is not ready.. Retry in 5 seconds" )
125- return ctrl.Result {RequeueAfter : 5 * time .Second }, nil
126- }
127-
128118 // Check if istio-proxy is injected
129119 // At he boostrap time of the cluster the operator will install istio. Later in the Process the operator needs
130120 // to communicate via the proxy with KCP. Once Istio is up and running the operator will be restarted to ensure
131121 // this communication will work
132- if ! r .cfg .IsLocal {
122+ if r .cfgOperator .Subroutines .Deployment .EnableIstio {
123+
124+ // Wait for istiod release to be ready before continuing
125+ rel , err := getHelmRelease (ctx , r .client , "istio-istiod" , "default" )
126+ if err != nil {
127+ log .Error ().Err (err ).Msg ("Failed to get istio-istiod Release" )
128+ return ctrl.Result {}, errors .NewOperatorError (err , false , true )
129+ }
130+
131+ if ! MatchesCondition (rel , "Ready" ) {
132+ log .Info ().Msg ("istio-istiod Release is not ready.. Retry in 5 seconds" )
133+ return ctrl.Result {RequeueAfter : 5 * time .Second }, nil
134+ }
135+
133136 hasProxy , pod , err := r .hasIstioProxyInjected (ctx , "platform-mesh-operator" , "platform-mesh-system" )
134137 if err != nil {
135138 log .Error ().Err (err ).Msg ("Failed to check if istio-proxy is injected" )
0 commit comments