Skip to content
Permalink
Browse files
Get e2e tests working (#6)
- Cleanup Application scheme registration.
- Fix test sample paths
- Set controller synctime to 2 mins
- Cleanup Scheme registration in controller-reconciler
- Use custom codec that is created from custom scheme (kb v2 uses custom
scheme)
  • Loading branch information
barney-s authored and kaxil committed Jan 24, 2020
1 parent 4152ae7 commit dd430eaa7c3add972f410e058a2fe0a4a58eeb64
Showing 9 changed files with 33 additions and 22 deletions.
@@ -69,6 +69,7 @@ func (r *AirflowBaseReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

// SetupWithManager - called by main
func (r *AirflowBaseReconciler) SetupWithManager(mgr ctrl.Manager) error {
_ = app.AddToScheme(r.Scheme)
return ctrl.NewControllerManagedBy(mgr).
For(&alpha1.AirflowBase{}).
Complete(abReconciler(mgr))
@@ -86,7 +87,6 @@ func abReconciler(mgr manager.Manager) *gr.Reconciler {
WithErrorHandler(abHandleError).
WithValidator(validate).
WithDefaulter(applyDefaults).
RegisterSchemeBuilder(app.SchemeBuilder).
Build()
}

@@ -90,6 +90,7 @@ func (r *AirflowClusterReconciler) Reconcile(req ctrl.Request) (ctrl.Result, err

// SetupWithManager - called by main
func (r *AirflowClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
_ = app.AddToScheme(r.Scheme)
return ctrl.NewControllerManagedBy(mgr).
For(&alpha1.AirflowCluster{}).
Complete(acReconciler(mgr))
@@ -110,7 +111,6 @@ func acReconciler(mgr manager.Manager) *gr.Reconciler {
WithErrorHandler(acHandleError).
WithValidator(acValidate).
WithDefaulter(acApplyDefaults).
RegisterSchemeBuilder(app.SchemeBuilder).
Build()
}

@@ -18,6 +18,7 @@ package main
import (
"flag"
"os"
"time"

airflowv1alpha1 "github.com/apache/airflow-on-k8s-operator/api/v1alpha1"
"github.com/apache/airflow-on-k8s-operator/controllers"
@@ -38,6 +39,7 @@ func init() {
_ = clientgoscheme.AddToScheme(scheme)

_ = airflowv1alpha1.AddToScheme(scheme)

// +kubebuilder:scaffold:scheme
}

@@ -53,11 +55,14 @@ func main() {
o.Development = true
}))

syncperiod := time.Minute * 2

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
Port: 9443,
SyncPeriod: &syncperiod,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
@@ -27,7 +27,7 @@ import (

const (
CRName = "AirflowBase"
SampleDir = "../../hack/sample/"
SampleDir = "../../../hack/sample/"
)

var f *test.Framework
@@ -27,7 +27,7 @@ import (

const (
CRName = "AirflowCluster"
SampleDir = "../../hack/sample/"
SampleDir = "../../../hack/sample/"
)

var f *test.Framework
@@ -27,7 +27,7 @@ import (

const (
CRName = "AirflowCluster"
SampleDir = "../../hack/sample/"
SampleDir = "../../../hack/sample/"
)

var f *test.Framework

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

0 comments on commit dd430ea

Please sign in to comment.