Fix e2e tests

This commit is contained in:
Tomasz Sęk 2019-06-29 17:06:38 +02:00
parent 9a88f45efe
commit f7b6443fc6
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
4 changed files with 13 additions and 1 deletions

View File

@ -135,7 +135,9 @@ type Container struct {
// Plugin defines Jenkins plugin
type Plugin struct {
Name string `json:"name"`
// Name is the name of Jenkins plugin
Name string `json:"name"`
// Version is the version of Jenkins plugin
Version string `json:"version"`
}

View File

@ -4,6 +4,7 @@
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/runtime/scheme"
)
@ -36,6 +37,13 @@ func (in *Jenkins) GroupVersionKind() schema.GroupVersionKind {
}
}
func JenkinsTypeMeta() metav1.TypeMeta {
return metav1.TypeMeta{
Kind: Kind,
APIVersion: SchemeGroupVersion.String(),
}
}
func init() {
SchemeBuilder.Register(&Jenkins{}, &JenkinsList{})
}

View File

@ -67,6 +67,7 @@ func createJenkinsCR(t *testing.T, name, namespace string, seedJob *[]v1alpha2.S
}
jenkins := &v1alpha2.Jenkins{
TypeMeta: v1alpha2.JenkinsTypeMeta(),
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,

View File

@ -72,6 +72,7 @@ func createPVC(t *testing.T, namespace string) {
func createJenkinsWithBackupAndRestoreConfigured(t *testing.T, name, namespace string) *v1alpha2.Jenkins {
containerName := "backup"
jenkins := &v1alpha2.Jenkins{
TypeMeta: v1alpha2.JenkinsTypeMeta(),
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,