Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Start KinD Cluster
# Start a KinD K8s cluster with single worker node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coherence-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Start KinD Cluster
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compatibility-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Start KinD Cluster
# Start a KinD K8s cluster with single worker node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/k8s-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Start KinD Cluster
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x

- name: Start KinD Cluster
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test/**/test-report.xml
/hack/sdk/*

# Generated file created by the build
/pkg/data/zz_generated_assets.go
bundle.Dockerfile
/__debug_bin
/istio-1.9.2/
/java/certs/
357 changes: 177 additions & 180 deletions Makefile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/v1/coherenceresource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func ensureV1CRDs(logger logr.Logger, scheme *runtime.Scheme, cl client.Client,

// ensureV1CRD ensures that the specified V1 CRD is loaded using the specified embedded CRD file
func ensureV1CRD(logger logr.Logger, cl client.Client, fileName string) error {
f, err := data.Assets.Open(fileName)
f, err := data.Assets.Open("assets/" + fileName)
if err != nil {
return errors.Wrap(err, "opening embedded CRD asset "+fileName)
}
Expand Down
21 changes: 0 additions & 21 deletions bundle.Dockerfile

This file was deleted.

5 changes: 5 additions & 0 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ vars:
kind: Service
version: v1
name: webhook
- name: WEBHOOK_SECRET_NAME
objref:
kind: Secret
version: v1
name: coherence-webhook-server-cert
1 change: 1 addition & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- webhook-secret.yaml
- manager.yaml
- service.yaml

Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
- name: WEBHOOK_SERVICE
value: $(WEBHOOK_SERVICE_NAME)
- name: WEBHOOK_SECRET
value: coherence-webhook-server-cert
value: $(WEBHOOK_SECRET_NAME)
- name: SERVICE_NAME
value: $(REST_SERVICE_NAME)
volumeMounts:
Expand Down
9 changes: 9 additions & 0 deletions config/manager/webhook-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
apiVersion: v1
kind: Secret
metadata:
name: coherence-webhook-server-cert
namespace: coherence
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,43 @@ apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
alm-examples: '[ { "apiVersion": "coherence.oracle.com/v1", "kind": "Coherence",
"metadata": { "name": "coherence-example" }, "spec": { "replicas": 3 } }]'
capabilities: Full Lifecycle
categories: Database
certified: 'false'
createdAt: ''
description: >-
Coherence Operator implements features to assist with deploying and
managing Coherence clusters in a Kubernetes environment.
containerImage: 'ghcr.io/oracle/coherence-operator:3.2.0'
support: ''
repository: 'https://github.com/oracle/coherence-operator'
operators.operatorframework.io/builder: operator-sdk-v1.0.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
name: coherence-operator.v3.1.3
name: coherence-operator.v3.2.0
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: Coherence is the Schema for the coherence API
kind: Coherence
name: coherence.coherence.oracle.com
version: v1
- description: Coherence is the Schema for the Coherence API.
- description: Coherence is the Schema for the Coherence Operator API.
displayName: Coherence
kind: Coherence
name: coherence.coherence.oracle.com.oracle.com
version: v1
description: Oracle Coherence Operator
description: |
The Coherence Operator implements features to assist with deploying and
managing Coherence clusters in a Kubernetes environment.

### Installation Guide & Configuration

For the complete installation guide and all configuration options please refer to
[Coherence Operator Documentation](https://oracle.github.io/coherence-operator/docs/latest/#/about/01_overview).
displayName: Coherence
icon:
- base64data: ""
mediatype: ""
- base64data: iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAIK2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0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tUWfX2EXO3DVzizZuzrRla9U18K1ALENi+ZUCr6SLDNWXzU3ByT6Jfb4pz+UzNm7AdQbyyeOL/PybG6LW0ECCv1qfhALsISz8siO71uR/PK9XGkNwbEdtSbaQiClL11vqZj21J29NlW1LXxYbKyusvSvQFiK6LzhNjWBQhP7L2ax0rWiUsdPq1FilkuV/U9mr0DQsb4lMvsuI8wjE8ztk1/qhVA7NPq13IRzIlXf0ObmXXEXErjaAM7FSDi0CogFpgumNKHh8H2v8oxCCC2QdQv8H4ZE/JhXuaGYfooLm3/XY5BAWGDMgy7cGlgUR7ql1gPnz5/4dHL9m5QFPUjm1YYfs9m9HXOyabMJyCi+nT1I62c7Bt6zCIITM3Wp5mY3Pz8UVdfdAg+Ql4yq8ZTzahxoTdcU39EIZ3Sl3yw150DYhviZJZWtHJcjAmKva7CNrbv2WNvAGGjqF+2zD808oa3GhM9CWxmAenlOUMbZrsz9oeYp9xDKxOwn14wc0ex5oHsjsSOAzsO7Diw48COA73hwF/JV5eOHd1hjQAAAABJRU5ErkJggg==
mediatype: image/png
install:
spec:
deployments: null
Expand All @@ -45,6 +58,10 @@ spec:
- name: Coherence Operator
url: https://oracle.github.io/coherence-operator/docs/latest
maturity: alpha
minKubeVersion: "1.16"
maintainers:
- name: Jonathan Knight
email: jonathan.knight@oracle.com
provider:
name: Oracle
url: https://oracle.github.io/coherence-operator/docs/latest
Expand Down
6 changes: 5 additions & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
resources:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../default
- ../samples
- ../scorecard
6 changes: 0 additions & 6 deletions config/namespace/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,3 @@ kind: Namespace
metadata:
name: coherence
---
apiVersion: v1
kind: Secret
metadata:
name: coherence-webhook-server-cert
namespace: coherence
---
2 changes: 1 addition & 1 deletion config/scorecard/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ patchesJson6902:
version: v1alpha3
kind: Configuration
name: config
# +kubebuilder:scaffold:patchesJson6902
#+kubebuilder:scaffold:patchesJson6902
10 changes: 5 additions & 5 deletions controllers/coherence_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (in *CoherenceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
// Remove the finalizer. Once all finalizers have been
// removed, the object will be deleted.
controllerutil.RemoveFinalizer(deployment, coh.Finalizer)
err := in.GetClient().Update(context.TODO(), deployment)
err := in.GetClient().Update(ctx, deployment)
if err != nil {
return ctrl.Result{}, err
}
Expand All @@ -116,7 +116,7 @@ func (in *CoherenceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
// Add finalizer for this CR if required
if utils.StringArrayDoesNotContain(deployment.GetFinalizers(), coh.Finalizer) {
// Adding the finalizer causes an update so the request will come around again
if err := in.addFinalizer(deployment); err != nil {
if err := in.addFinalizer(ctx, deployment); err != nil {
return ctrl.Result{}, err
}
}
Expand Down Expand Up @@ -280,12 +280,12 @@ func (in *CoherenceReconciler) watchSecondaryResource(s reconciler.SecondaryReso

func (in *CoherenceReconciler) GetReconciler() reconcile.Reconciler { return in }

func (in *CoherenceReconciler) addFinalizer(c *coh.Coherence) error {
func (in *CoherenceReconciler) addFinalizer(ctx context.Context, c *coh.Coherence) error {
in.Log.Info("Adding Finalizer to Coherence resource", "Namespace", c.Namespace, "Name", c.Name)
controllerutil.AddFinalizer(c, coh.Finalizer)

// Update CR
err := in.GetClient().Update(context.TODO(), c)
err := in.GetClient().Update(ctx, c)
if err != nil {
in.Log.Error(err, "Failed to update Coherence resource with finalizer",
"Namespace", c.Namespace, "Name", c.Name)
Expand Down Expand Up @@ -327,7 +327,7 @@ func (in *CoherenceReconciler) finalizeDeployment(ctx context.Context, c *coh.Co
Client: in.GetClient(),
Config: in.GetManager().GetConfig(),
}
if probe.SuspendServices(c, sts) == statefulset.ServiceSuspendFailed {
if probe.SuspendServices(ctx, c, sts) == statefulset.ServiceSuspendFailed {
return fmt.Errorf("failed to suspend services")
}
}
Expand Down
16 changes: 8 additions & 8 deletions controllers/servicemonitor/servicemonitor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (in *ReconcileServiceMonitor) ReconcileResources(ctx context.Context, req r
diff := store.GetLatest().DiffForKind(in.Kind, store.GetPrevious())
for _, res := range diff {
if res.IsDelete() {
if err = in.monClient.ServiceMonitors(req.Namespace).Delete(context.TODO(), res.Name, metav1.DeleteOptions{}); err != nil {
if err = in.monClient.ServiceMonitors(req.Namespace).Delete(ctx, res.Name, metav1.DeleteOptions{}); err != nil {
logger.Info(fmt.Sprintf("Finished reconciling all %s for d with error: %s", in.Kind, err.Error()))
return reconcile.Result{}, err
}
Expand All @@ -113,7 +113,7 @@ func (in *ReconcileServiceMonitor) ReconcileResource(ctx context.Context, namesp

// Fetch the sm's current state
var exists bool
sm, err := in.monClient.ServiceMonitors(namespace).Get(context.TODO(), name, metav1.GetOptions{})
sm, err := in.monClient.ServiceMonitors(namespace).Get(ctx, name, metav1.GetOptions{})
switch {
case err != nil && apierrors.IsNotFound(err):
// we can ignore not found errors
Expand Down Expand Up @@ -141,11 +141,11 @@ func (in *ReconcileServiceMonitor) ReconcileResource(ctx context.Context, namesp
// ensure that the sm is deleted.
// This should not actually be required as everything is owned by the deployment
// and there should be a cascaded delete by k8s so it's belt and braces.
err = in.monClient.ServiceMonitors(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{})
err = in.monClient.ServiceMonitors(namespace).Delete(ctx, name, metav1.DeleteOptions{})
}
case !exists:
// ServiceMonitor does not exist but deployment does so create it
err = in.CreateServiceMonitor(namespace, name, storage, logger)
err = in.CreateServiceMonitor(ctx, namespace, name, storage, logger)
if err != nil {
err = errors.Wrapf(err, "Failed to create ServiceMonitor %s/%s", namespace, name)
}
Expand All @@ -157,7 +157,7 @@ func (in *ReconcileServiceMonitor) ReconcileResource(ctx context.Context, namesp
}

// CreateServiceMonitor creates a ServiceMonitor spec.
func (in *ReconcileServiceMonitor) CreateServiceMonitor(namespace, name string, storage utils.Storage, logger logr.Logger) error {
func (in *ReconcileServiceMonitor) CreateServiceMonitor(ctx context.Context, namespace, name string, storage utils.Storage, logger logr.Logger) error {
logger.Info(fmt.Sprintf("Creating ServiceMonitor/%s for deployment", name))
// Get the ServiceMonitor desired state
resource, found := storage.GetLatest().GetResource(in.Kind, name)
Expand All @@ -166,7 +166,7 @@ func (in *ReconcileServiceMonitor) CreateServiceMonitor(namespace, name string,
}
// create the ServiceMonitor
sm := resource.Spec.(*monitoringv1.ServiceMonitor)
_, err := in.monClient.ServiceMonitors(namespace).Create(context.TODO(), sm, metav1.CreateOptions{})
_, err := in.monClient.ServiceMonitors(namespace).Create(ctx, sm, metav1.CreateOptions{})
if err != nil {
logger.Info(fmt.Sprintf("Failed creating ServiceMonitor %s/%s - %s", namespace, name, err.Error()))
return errors.Wrapf(err, "failed to create ServiceMonitor %s/%s", namespace, name)
Expand All @@ -175,7 +175,7 @@ func (in *ReconcileServiceMonitor) CreateServiceMonitor(namespace, name string,
}

// UpdateServiceMonitor possibly updates the ServiceMonitor if the current state differs from the desired state.
func (in *ReconcileServiceMonitor) UpdateServiceMonitor(namespace, name string, current runtime.Object, storage utils.Storage) error {
func (in *ReconcileServiceMonitor) UpdateServiceMonitor(ctx context.Context, namespace, name string, current runtime.Object, storage utils.Storage) error {
original, _ := storage.GetPrevious().GetResource(in.Kind, name)
desired, found := storage.GetLatest().GetResource(in.Kind, name)
if !found {
Expand All @@ -197,7 +197,7 @@ func (in *ReconcileServiceMonitor) UpdateServiceMonitor(namespace, name string,
}

in.GetLog().WithValues().Info(fmt.Sprintf("Patching ServiceMonitor %s/%s", namespace, name))
_, err = in.monClient.ServiceMonitors(namespace).Patch(context.TODO(), name, in.GetPatchType(), data, metav1.PatchOptions{})
_, err = in.monClient.ServiceMonitors(namespace).Patch(ctx, name, in.GetPatchType(), data, metav1.PatchOptions{})
if err != nil {
return errors.Wrapf(err, "cannot patch ServiceMonitor %s/%s", namespace, name)
}
Expand Down
Loading