...

Source file src/github.com/redhat-developer/odo/pkg/testingutil/services.go

Documentation: github.com/redhat-developer/odo/pkg/testingutil

     1  package testingutil
     2  
     3  import (
     4  	corev1 "k8s.io/api/core/v1"
     5  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     6  
     7  	odolabels "github.com/redhat-developer/odo/pkg/labels"
     8  )
     9  
    10  func FakeKubeService(componentName, serviceName string) corev1.Service {
    11  	labels := odolabels.GetLabels(componentName, "app", "", odolabels.ComponentDevMode, false)
    12  	return corev1.Service{
    13  		ObjectMeta: metav1.ObjectMeta{
    14  			Name:   serviceName,
    15  			Labels: labels,
    16  		},
    17  	}
    18  }
    19  
    20  func FakeKubeServices(componentName string) []corev1.Service {
    21  	return []corev1.Service{
    22  		FakeKubeService(componentName, "service-1"),
    23  		FakeKubeService(componentName, "service-2"),
    24  		FakeKubeService(componentName, "service-3"),
    25  	}
    26  }
    27  

View as plain text