@@ -25,7 +25,6 @@ import (
2525 "github.com/stackrox/roxie/internal/stackroxversions"
2626 "gopkg.in/yaml.v3"
2727 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
28- "k8s.io/utils/ptr"
2928)
3029
3130const (
@@ -55,39 +54,39 @@ Examples:
5554 registerFlag (cmd , settings , "olm" , "Deploy operator via OLM (requires OLM installed)" ,
5655 withNoOptDefVal ("true" ),
5756 withApplyFnBool (func (config * deployer.Config , val bool ) error {
58- config .Operator .DeployViaOlm = val
57+ config .Operator .DeployViaOlm = new ( val )
5958 return nil
6059 }),
6160 )
6261
6362 registerFlag (cmd , settings , "konflux" , "Use Konflux images" ,
6463 withNoOptDefVal ("true" ),
6564 withApplyFnBool (func (config * deployer.Config , val bool ) error {
66- config .Roxie .KonfluxImages = val
65+ config .Roxie .KonfluxImages = new ( val )
6766 return nil
6867 }),
6968 )
7069
7170 registerFlag (cmd , settings , "deploy-operator" , "Whether to deploy and manage the operator" ,
7271 withNoOptDefVal ("true" ),
7372 withApplyFnBool (func (config * deployer.Config , val bool ) error {
74- config .Operator .SkipDeployment = ! val
73+ config .Operator .SkipDeployment = new ( ! val )
7574 return nil
7675 }),
7776 )
7877
7978 registerFlag (cmd , settings , "port-forwarding" , "Enable localhost port-forward for Central" ,
8079 withNoOptDefVal ("true" ),
8180 withApplyFnBool (func (config * deployer.Config , val bool ) error {
82- config .Central .PortForwarding = ptr . To (val )
81+ config .Central .PortForwarding = new (val )
8382 return nil
8483 }),
8584 )
8685
8786 registerFlag (cmd , settings , "pause-reconciliation" , "Pause reconciliation after deployment" ,
8887 withNoOptDefVal ("true" ),
8988 withApplyFnBool (func (config * deployer.Config , val bool ) error {
90- config .Central .PauseReconciliation = val
89+ config .Central .PauseReconciliation = new ( val )
9190 config .SecuredCluster .PauseReconciliation = val
9291 return nil
9392 }),
@@ -120,7 +119,7 @@ Examples:
120119 if err := yaml .Unmarshal ([]byte (val ), & exposure ); err != nil {
121120 return err
122121 }
123- config .Central .Exposure = ptr . To (exposure )
122+ config .Central .Exposure = new (exposure )
124123 return nil
125124 }),
126125 )
@@ -228,7 +227,7 @@ Examples:
228227 registerFlag (cmd , settings , "early-readiness" , "Only wait for essential workloads (central/sensor) to be ready" ,
229228 withNoOptDefVal ("true" ),
230229 withApplyFnBool (func (config * deployer.Config , val bool ) error {
231- config .Central .EarlyReadiness = val
230+ config .Central .EarlyReadiness = new ( val )
232231 config .SecuredCluster .EarlyReadiness = val
233232 return nil
234233 }),
@@ -282,7 +281,7 @@ func runDeploy(cmd *cobra.Command, args []string) error {
282281 return err
283282 }
284283
285- if ! deploySettings .Central .EarlyReadiness || ! deploySettings .SecuredCluster .EarlyReadiness {
284+ if ! deploySettings .Central .EarlyReadinessEnabled () || ! deploySettings .SecuredCluster .EarlyReadiness {
286285 // Explanation on the versions involved here:
287286 // Deploying StackRox begins with picking a "main image tag" -- this is a version identifier, which cannot be reliably parsed as a semver.
288287 // But there is a derived version from that -- the operator version -- which can be parsed as a semver.
@@ -411,7 +410,7 @@ func configureConfig(log *logger.Logger, components component.Component, deployS
411410
412411 if ! deploySettings .Central .PortForwardingSet () && ! deploySettings .Central .ExposureEnabled () {
413412 log .Info ("Enabling port-forwarding due to no exposure" )
414- deploySettings .Central .PortForwarding = ptr . To (true )
413+ deploySettings .Central .PortForwarding = new (true )
415414 }
416415
417416 return nil
@@ -448,12 +447,12 @@ func deployValidate(components component.Component, deploySettings *deployer.Con
448447 }
449448 }
450449
451- if deploySettings .Operator .SkipDeployment && deploySettings .Operator .DeployViaOlm {
450+ if deploySettings .Operator .SkipDeploymentEnabled () && deploySettings .Operator .DeployViaOlmEnabled () {
452451 return errors .New ("skipping operator deployment while also requesting deploying via OLM at the same time does not make sense" )
453452 }
454453
455- if deploySettings .Roxie .KonfluxImages {
456- if deploySettings .Operator .DeployViaOlm {
454+ if deploySettings .Roxie .KonfluxImagesEnabled () {
455+ if deploySettings .Operator .DeployViaOlmEnabled () {
457456 return errors .New ("using Konflux images while deploying operator via OLM is not supported" )
458457 }
459458 if ! clusterType .IsOpenShift () {
0 commit comments