|
|
|
@@ -2,9 +2,11 @@ package base
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"fmt"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2"
|
|
|
|
|
"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/configuration"
|
|
|
|
|
"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/configuration/base/resources"
|
|
|
|
|
"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/constants"
|
|
|
|
|
"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/plugins"
|
|
|
|
@@ -15,15 +17,13 @@ import (
|
|
|
|
|
"k8s.io/api/core/v1"
|
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
|
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
|
|
|
"k8s.io/client-go/kubernetes"
|
|
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
|
|
|
|
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestValidatePlugins(t *testing.T) {
|
|
|
|
|
log.SetupLogger(true)
|
|
|
|
|
baseReconcileLoop := New(nil, nil, log.Log,
|
|
|
|
|
nil, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{}, nil, log.Log, false, false, nil)
|
|
|
|
|
t.Run("empty", func(t *testing.T) {
|
|
|
|
|
var requiredBasePlugins []plugins.Plugin
|
|
|
|
|
var basePlugins []v1alpha2.Plugin
|
|
|
|
@@ -163,10 +163,13 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
fmt.Println(got)
|
|
|
|
|
assert.Nil(t, got)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
})
|
|
|
|
@@ -184,8 +187,10 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, nil, false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
|
|
|
|
@@ -218,8 +223,10 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, nil, false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
|
|
|
|
@@ -252,8 +259,10 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
|
|
|
|
@@ -286,8 +295,10 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
|
|
|
|
@@ -320,8 +331,10 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
|
|
|
|
|
|
|
|
@@ -352,8 +365,9 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
|
|
|
|
assert.Nil(t, got)
|
|
|
|
|
})
|
|
|
|
@@ -378,8 +392,9 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, got, []string{"Jenkins Master container env 'JENKINS_HOME' cannot be overridden"})
|
|
|
|
@@ -401,8 +416,9 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djava.awt.headless=true'"})
|
|
|
|
@@ -424,8 +440,9 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djenkins.install.runSetupWizard=false'"})
|
|
|
|
@@ -445,8 +462,9 @@ func TestValidateReservedVolumes(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateReservedVolumes()
|
|
|
|
|
assert.Nil(t, got)
|
|
|
|
|
})
|
|
|
|
@@ -462,8 +480,9 @@ func TestValidateReservedVolumes(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateReservedVolumes()
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, got, []string{"Jenkins Master pod volume 'jenkins-home' is reserved please choose different one"})
|
|
|
|
@@ -477,8 +496,9 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
|
|
|
|
Master: v1alpha2.JenkinsMaster{},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateContainerVolumeMounts(v1alpha2.Container{})
|
|
|
|
|
assert.Nil(t, got)
|
|
|
|
|
})
|
|
|
|
@@ -504,8 +524,9 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
|
|
|
|
assert.Nil(t, got)
|
|
|
|
|
})
|
|
|
|
@@ -531,8 +552,9 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
|
|
|
|
assert.Equal(t, got, []string{"mountPath not set for 'example' volume mount in container ''"})
|
|
|
|
|
})
|
|
|
|
@@ -553,8 +575,9 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
baseReconcileLoop := New(nil, nil, logf.ZapLogger(false),
|
|
|
|
|
&jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: &jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, got, []string{"Not found volume for 'missing-volume' volume mount in container ''"})
|
|
|
|
@@ -574,8 +597,9 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
nil, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
|
|
|
|
|
|
|
|
@@ -600,8 +624,10 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
err := fakeClient.Create(context.TODO(), &configMap)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
|
|
|
|
|
|
|
|
@@ -624,8 +650,10 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
|
|
|
|
|
|
|
|
@@ -648,8 +676,9 @@ func TestValidateSecretVolume(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
nil, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
|
|
|
|
|
|
|
|
@@ -672,8 +701,10 @@ func TestValidateSecretVolume(t *testing.T) {
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
err := fakeClient.Create(context.TODO(), &secret)
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
|
|
|
|
|
|
|
|
@@ -694,8 +725,10 @@ func TestValidateSecretVolume(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
|
|
|
|
|
|
|
|
|
assert.NoError(t, err)
|
|
|
|
@@ -716,8 +749,10 @@ func TestValidateCustomization(t *testing.T) {
|
|
|
|
|
t.Run("empty", func(t *testing.T) {
|
|
|
|
|
customization := v1alpha2.Customization{}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
|
|
|
|
|
got, err := baseReconcileLoop.validateCustomization(customization, "spec.groovyScripts")
|
|
|
|
|
|
|
|
|
@@ -736,8 +771,10 @@ func TestValidateCustomization(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
@@ -765,8 +802,10 @@ func TestValidateCustomization(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
err = fakeClient.Create(context.TODO(), configMap)
|
|
|
|
@@ -790,8 +829,10 @@ func TestValidateCustomization(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
err := fakeClient.Create(context.TODO(), configMap)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
@@ -813,8 +854,10 @@ func TestValidateCustomization(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
fakeClient := fake.NewFakeClient()
|
|
|
|
|
baseReconcileLoop := New(fakeClient, nil, logf.ZapLogger(false),
|
|
|
|
|
jenkins, false, false, kubernetes.Clientset{}, nil, nil)
|
|
|
|
|
baseReconcileLoop := New(configuration.Configuration{
|
|
|
|
|
Jenkins: jenkins,
|
|
|
|
|
Client: fakeClient,
|
|
|
|
|
}, nil, logf.ZapLogger(false), false, false, nil)
|
|
|
|
|
err := fakeClient.Create(context.TODO(), secret)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
|
|