Skip to content

Commit

Permalink
deprecate deployMessagingService flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nasark committed Nov 6, 2023
1 parent fae713c commit f7abcf1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
10 changes: 0 additions & 10 deletions manageiq-operator/api/v1alpha1/helpers/miq-components/cr.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ func databaseVolumeCapacity(cr *miqv1alpha1.ManageIQ) string {
}
}

func deployMessagingService(cr *miqv1alpha1.ManageIQ) bool {
if cr.Spec.DeployMessagingService == nil {
return false
} else {
return *cr.Spec.DeployMessagingService
}
}

func enableApplicationLocalLogin(cr *miqv1alpha1.ManageIQ) bool {
if cr.Spec.EnableApplicationLocalLogin == nil {
return true
Expand Down Expand Up @@ -347,7 +339,6 @@ func zookeeperVolumeCapacity(cr *miqv1alpha1.ManageIQ) string {

func ManageCR(cr *miqv1alpha1.ManageIQ, c *client.Client) (*miqv1alpha1.ManageIQ, controllerutil.MutateFn) {
f := func() error {
varDeployMessagingService := deployMessagingService(cr)
varEnableApplicationLocalLogin := enableApplicationLocalLogin(cr)
varEnableSSO := enableSSO(cr)
varEnforceWorkerResourceConstraints := enforceWorkerResourceConstraints(cr)
Expand All @@ -357,7 +348,6 @@ func ManageCR(cr *miqv1alpha1.ManageIQ, c *client.Client) (*miqv1alpha1.ManageIQ
cr.Spec.DatabaseRegion = databaseRegion(cr)
cr.Spec.DatabaseSecret = databaseSecret(cr)
cr.Spec.DatabaseVolumeCapacity = databaseVolumeCapacity(cr)
cr.Spec.DeployMessagingService = &varDeployMessagingService
cr.Spec.EnableApplicationLocalLogin = &varEnableApplicationLocalLogin
cr.Spec.EnableSSO = &varEnableSSO
cr.Spec.EnforceWorkerResourceConstraints = &varEnforceWorkerResourceConstraints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ func orchestratorObjectName(cr *miqv1alpha1.ManageIQ) string {
}

func addMessagingEnv(cr *miqv1alpha1.ManageIQ, c *corev1.Container) {
if !*cr.Spec.DeployMessagingService {
return
}

messagingEnv := []corev1.EnvVar{
corev1.EnvVar{
Name: "MESSAGING_HOSTNAME",
Expand Down
3 changes: 1 addition & 2 deletions manageiq-operator/api/v1alpha1/manageiq_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ type ManageIQSpec struct {
// +optional
DatabaseVolumeCapacity string `json:"databaseVolumeCapacity,omitempty"`

// Flag to indicate if Kafka and Zookeeper should be deployed (default: false)
// +optional
// Deprecated: Flag to indicate if Kafka and Zookeeper should be deployed (default: false)
DeployMessagingService *bool `json:"deployMessagingService,omitempty"`

// Flag to allow logging into the application without SSO (default: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ spec:
description: 'Database volume size (default: 15Gi)'
type: string
deployMessagingService:
description: 'Flag to indicate if Kafka and Zookeeper should be deployed
(default: false)'
description: 'Deprecated: Flag to indicate if Kafka and Zookeeper
should be deployed (default: false)'
type: boolean
enableApplicationLocalLogin:
description: 'Flag to allow logging into the application without SSO
Expand Down
8 changes: 3 additions & 5 deletions manageiq-operator/internal/controller/manageiq_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ func (r *ManageIQReconciler) Reconcile(ctx context.Context, request ctrl.Request
if e := r.generateMemcachedResources(miqInstance); e != nil {
return reconcile.Result{}, e
}
if *miqInstance.Spec.DeployMessagingService {
logger.Info("Reconciling the Kafka resources...")
if e := r.generateKafkaResources(miqInstance); e != nil {
return reconcile.Result{}, e
}
logger.Info("Reconciling the Kafka resources...")
if e := r.generateKafkaResources(miqInstance); e != nil {
return reconcile.Result{}, e
}
logger.Info("Reconciling the Orchestrator resources...")
if e := r.generateOrchestratorResources(miqInstance); e != nil {
Expand Down

0 comments on commit f7abcf1

Please sign in to comment.