mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-22 07:02:58 +02:00
@@ -402,7 +402,7 @@ func (r *ReconcileJenkinsBaseConfiguration) ensureExtraRBAC(meta metav1.ObjectMe
|
||||
}
|
||||
|
||||
roleBindings := &rbacv1.RoleBindingList{}
|
||||
err = r.Client.List(context.TODO(), &client.ListOptions{Namespace: r.Configuration.Jenkins.Namespace}, roleBindings)
|
||||
err = r.Client.List(context.TODO(), roleBindings, client.InNamespace(r.Configuration.Jenkins.Namespace))
|
||||
if err != nil {
|
||||
return stackerr.WithStack(err)
|
||||
}
|
||||
@@ -857,7 +857,7 @@ func (r *ReconcileJenkinsBaseConfiguration) detectJenkinsMasterPodStartingIssues
|
||||
now := time.Now().UTC()
|
||||
if now.After(timeout) {
|
||||
events := &corev1.EventList{}
|
||||
err = r.Client.List(context.TODO(), &client.ListOptions{Namespace: r.Configuration.Jenkins.Namespace}, events)
|
||||
err = r.Client.List(context.TODO(), events, client.InNamespace(r.Configuration.Jenkins.Namespace))
|
||||
if err != nil {
|
||||
return false, stackerr.WithStack(err)
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ func TestEnsureExtraRBAC(t *testing.T) {
|
||||
|
||||
fetchAllRoleBindings := func(client k8sclient.Client) (roleBindings *rbacv1.RoleBindingList, err error) {
|
||||
roleBindings = &rbacv1.RoleBindingList{}
|
||||
err = client.List(context.TODO(), &k8sclient.ListOptions{Namespace: namespace}, roleBindings)
|
||||
err = client.List(context.TODO(), roleBindings, k8sclient.InNamespace(namespace))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
)
|
||||
|
||||
func TestValidatePlugins(t *testing.T) {
|
||||
@@ -166,7 +166,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateImagePullSecrets()
|
||||
fmt.Println(got)
|
||||
@@ -262,7 +262,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
||||
|
||||
@@ -298,7 +298,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
||||
|
||||
@@ -334,7 +334,7 @@ func TestReconcileJenkinsBaseConfiguration_validateImagePullSecrets(t *testing.T
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, _ := baseReconcileLoop.validateImagePullSecrets()
|
||||
|
||||
@@ -367,7 +367,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
||||
assert.Nil(t, got)
|
||||
})
|
||||
@@ -390,7 +390,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
||||
|
||||
assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djava.awt.headless=true'"})
|
||||
@@ -414,7 +414,7 @@ func TestValidateJenkinsMasterPodEnvs(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateJenkinsMasterPodEnvs()
|
||||
|
||||
assert.Equal(t, got, []string{"Jenkins Master container env 'JAVA_OPTS' doesn't have required flag '-Djenkins.install.runSetupWizard=false'"})
|
||||
@@ -436,7 +436,7 @@ func TestValidateReservedVolumes(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateReservedVolumes()
|
||||
assert.Nil(t, got)
|
||||
})
|
||||
@@ -454,7 +454,7 @@ func TestValidateReservedVolumes(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateReservedVolumes()
|
||||
|
||||
assert.Equal(t, got, []string{"Jenkins Master pod volume 'jenkins-home' is reserved please choose different one"})
|
||||
@@ -470,7 +470,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateContainerVolumeMounts(v1alpha2.Container{})
|
||||
assert.Nil(t, got)
|
||||
})
|
||||
@@ -498,7 +498,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
||||
assert.Nil(t, got)
|
||||
})
|
||||
@@ -526,7 +526,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
||||
assert.Equal(t, got, []string{"mountPath not set for 'example' volume mount in container ''"})
|
||||
})
|
||||
@@ -549,7 +549,7 @@ func TestValidateContainerVolumeMounts(t *testing.T) {
|
||||
}
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: &jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got := baseReconcileLoop.validateContainerVolumeMounts(jenkins.Spec.Master.Containers[0])
|
||||
|
||||
assert.Equal(t, got, []string{"Not found volume for 'missing-volume' volume mount in container ''"})
|
||||
@@ -571,7 +571,7 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
||||
fakeClient := fake.NewFakeClient()
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
||||
|
||||
@@ -599,7 +599,7 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
||||
|
||||
@@ -625,13 +625,13 @@ func TestValidateConfigMapVolume(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateConfigMapVolume(volume)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, got, []string{"ConfigMap 'configmap-name' not found for volume '{volume-name {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:configmap-name,},Items:[],DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil}}'"})
|
||||
assert.Equal(t, got, []string{"ConfigMap 'configmap-name' not found for volume '{volume-name {nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil &ConfigMapVolumeSource{LocalObjectReference:LocalObjectReference{Name:configmap-name,},Items:[]KeyToPath{},DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil}}'"})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ func TestValidateSecretVolume(t *testing.T) {
|
||||
fakeClient := fake.NewFakeClient()
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
||||
|
||||
@@ -676,7 +676,7 @@ func TestValidateSecretVolume(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
||||
|
||||
@@ -700,12 +700,12 @@ func TestValidateSecretVolume(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Client: fakeClient,
|
||||
Jenkins: jenkins,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
got, err := baseReconcileLoop.validateSecretVolume(volume)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, got, []string{"Secret 'secret-name' not found for volume '{volume-name {nil nil nil nil nil &SecretVolumeSource{SecretName:secret-name,Items:[],DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil}}'"})
|
||||
assert.Equal(t, got, []string{"Secret 'secret-name' not found for volume '{volume-name {nil nil nil nil nil &SecretVolumeSource{SecretName:secret-name,Items:[]KeyToPath{},DefaultMode:nil,Optional:*false,} nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil}}'"})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -724,7 +724,7 @@ func TestValidateCustomization(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: jenkins,
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
|
||||
got, err := baseReconcileLoop.validateCustomization(customization, "spec.groovyScripts")
|
||||
|
||||
@@ -746,7 +746,7 @@ func TestValidateCustomization(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: jenkins,
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
err := fakeClient.Create(context.TODO(), secret)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -777,7 +777,7 @@ func TestValidateCustomization(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: jenkins,
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
err := fakeClient.Create(context.TODO(), secret)
|
||||
require.NoError(t, err)
|
||||
err = fakeClient.Create(context.TODO(), configMap)
|
||||
@@ -804,7 +804,7 @@ func TestValidateCustomization(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: jenkins,
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
err := fakeClient.Create(context.TODO(), configMap)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -829,7 +829,7 @@ func TestValidateCustomization(t *testing.T) {
|
||||
baseReconcileLoop := New(configuration.Configuration{
|
||||
Jenkins: jenkins,
|
||||
Client: fakeClient,
|
||||
}, logf.ZapLogger(false), client.JenkinsAPIConnectionSettings{})
|
||||
}, logf.Logger(false), client.JenkinsAPIConnectionSettings{})
|
||||
err := fakeClient.Create(context.TODO(), secret)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
)
|
||||
|
||||
func jenkinsCustomResource() *v1alpha2.Jenkins {
|
||||
@@ -67,7 +67,7 @@ func jenkinsCustomResource() *v1alpha2.Jenkins {
|
||||
func TestEnsureSeedJobs(t *testing.T) {
|
||||
t.Run("happy", func(t *testing.T) {
|
||||
// given
|
||||
logger := logf.ZapLogger(false)
|
||||
logger := logf.Logger(false)
|
||||
ctrl := gomock.NewController(t)
|
||||
ctx := context.TODO()
|
||||
defer ctrl.Finish()
|
||||
@@ -118,7 +118,7 @@ func TestEnsureSeedJobs(t *testing.T) {
|
||||
|
||||
t.Run("delete agent deployment when no seed jobs", func(t *testing.T) {
|
||||
// given
|
||||
logger := logf.ZapLogger(false)
|
||||
logger := logf.Logger(false)
|
||||
ctrl := gomock.NewController(t)
|
||||
ctx := context.TODO()
|
||||
defer ctrl.Finish()
|
||||
@@ -169,7 +169,7 @@ func TestEnsureSeedJobs(t *testing.T) {
|
||||
func TestCreateAgent(t *testing.T) {
|
||||
t.Run("don't fail when deployment is already created", func(t *testing.T) {
|
||||
// given
|
||||
logger := logf.ZapLogger(false)
|
||||
logger := logf.Logger(false)
|
||||
ctrl := gomock.NewController(t)
|
||||
ctx := context.TODO()
|
||||
defer ctrl.Finish()
|
||||
|
||||
@@ -12,7 +12,8 @@ import (
|
||||
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"
|
||||
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
)
|
||||
|
||||
var fakePrivateKey = `-----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -82,7 +83,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -110,7 +111,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -150,7 +151,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -189,7 +190,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -229,7 +230,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -260,7 +261,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -289,7 +290,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -318,7 +319,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -347,7 +348,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -387,7 +388,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -426,7 +427,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -466,7 +467,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -505,7 +506,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -544,7 +545,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -576,7 +577,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -609,7 +610,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -640,7 +641,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -677,7 +678,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -708,7 +709,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -745,7 +746,7 @@ func TestValidateSeedJobs(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
seedJobs := New(nil, config, logf.ZapLogger(false))
|
||||
seedJobs := New(nil, config, logf.Logger(false))
|
||||
result, err := seedJobs.ValidateSeedJobs(jenkins)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@@ -765,7 +766,7 @@ func TestValidateIfIDIsUnique(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
ctrl := New(nil, config, logf.ZapLogger(false))
|
||||
ctrl := New(nil, config, logf.Logger(false))
|
||||
got := ctrl.validateIfIDIsUnique(seedJobs)
|
||||
assert.Nil(t, got)
|
||||
})
|
||||
@@ -780,7 +781,7 @@ func TestValidateIfIDIsUnique(t *testing.T) {
|
||||
Notifications: nil,
|
||||
}
|
||||
|
||||
ctrl := New(nil, config, logf.ZapLogger(false))
|
||||
ctrl := New(nil, config, logf.Logger(false))
|
||||
got := ctrl.validateIfIDIsUnique(seedJobs)
|
||||
|
||||
assert.Equal(t, got, []string{"'first' seed job ID is not unique"})
|
||||
|
||||
Reference in New Issue
Block a user