Skip to content

Commit

Permalink
Merge pull request #346 from grdryn/INTLY-4671
Browse files Browse the repository at this point in the history
✨ Enable 'ops' addon on Syndesis for monitoring
  • Loading branch information
openshift-merge-robot authored Feb 5, 2020
2 parents fbaf68f + 1abcbe8 commit 72a342a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
capabilities: Basic Install
categories: security
certified: 'False'
containerImage: 'quay.io/keycloak/keycloak-operator:master'
containerImage: 'quay.io/wei_lee/keycloak-operator:intly'
createdAt: 2019-11-08 00:00:00
description: 'An Operator for installing and managing Keycloak'
repository: 'https://github.com/keycloak/keycloak-operator'
Expand Down Expand Up @@ -185,7 +185,7 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: keycloak-operator
image: quay.io/pb82/keycloak-operator:no-default-credentials
image: quay.io/wei_lee/keycloak-operator:intly
imagePullPolicy: Always
name: keycloak-operator
resources: {}
Expand Down
20 changes: 9 additions & 11 deletions pkg/products/fuse/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const (
manifestPackage = "integreatly-fuse"
)

// Reconciler reconciles everything needed to install Syndesis/Fuse. The resources that it works
// with are considered secondary resources in the context of the installation controller.
type Reconciler struct {
*resources.Reconciler
coreClient kubernetes.Interface
Expand All @@ -50,6 +52,7 @@ type Reconciler struct {
recorder record.EventRecorder
}

// NewReconciler instantiates and returns a reference to a new Reconciler.
func NewReconciler(configManager config.ConfigReadWriter, installation *integreatlyv1alpha1.Installation, mpm marketplace.MarketplaceInterface, recorder record.EventRecorder) (*Reconciler, error) {
fuseConfig, err := configManager.ReadFuse()
if err != nil {
Expand All @@ -75,6 +78,8 @@ func NewReconciler(configManager config.ConfigReadWriter, installation *integrea
}, nil
}

// GetPreflightObject returns an object that will be checked in the preflight checks in the main
// Installation controller to ensure there isn't a conflicting Syndesis already installed.
func (r *Reconciler) GetPreflightObject(ns string) runtime.Object {
return &appsv1.DeploymentConfig{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -260,26 +265,19 @@ func (r *Reconciler) reconcileCustomResource(ctx context.Context, installation *
},
},
Addons: syndesisv1alpha1.AddonsSpec{
"ops": syndesisv1alpha1.Parameters{
"enabled": "true",
},
"todo": syndesisv1alpha1.Parameters{
"enabled": "false",
},
},
}
owner.AddIntegreatlyOwnerAnnotations(cr, installation)
return nil
}); err != nil {
return integreatlyv1alpha1.PhaseFailed, fmt.Errorf("failed to create or update a Syndesis(Fuse) custom resource: %w", err)
}
owner.AddIntegreatlyOwnerAnnotations(cr, installation)
// attempt to create the custom resource
if err := client.Get(ctx, k8sclient.ObjectKey{Name: cr.Name, Namespace: cr.Namespace}, cr); err != nil {
if k8serr.IsNotFound(err) {
if err := client.Create(ctx, cr); err != nil && !k8serr.IsAlreadyExists(err) {
return integreatlyv1alpha1.PhaseFailed, fmt.Errorf("failed to create a syndesis cr when reconciling custom resource: %w", err)
}
return integreatlyv1alpha1.PhaseInProgress, nil
}
return integreatlyv1alpha1.PhaseFailed, fmt.Errorf("failed to get a syndesis cr when reconciling custom resource: %w", err)
}

if cr.Status.Phase == syndesisv1alpha1.SyndesisPhaseStartupFailed {
return integreatlyv1alpha1.PhaseFailed, fmt.Errorf("failed to install fuse custom resource: %s", cr.Status.Reason)
Expand Down

0 comments on commit 72a342a

Please sign in to comment.