Documentation ¶
Overview ¶
Package util is a generated GoMock package.
Index ¶
- Constants
- func AddEnvVarToDeployment(d *appsv1.Deployment, e v1.EnvVar, merge func(old, new string) string, ...)
- func BuildUrl(scheme string, hostWithoutPort string, port int32) string
- func CreateOrUpdateService(svc *corev1.Service, rawClient *kubernetes.Clientset) error
- func CreateOrUpdateValidatingWebhookConfiguration(config *v1beta1.ValidatingWebhookConfiguration, ...) error
- func FindDeployment(c client.Client, spinsvc interfaces.SpinnakerService, service string) (*v12.Deployment, error)
- func FindLoadBalancerUrl(svcName string, namespace string, client client.Client, hcSSLEnabled bool) (string, error)
- func FindSecretInDeployment(c client.Client, dep *v12.Deployment, containerName, path string) (*v1.Secret, error)
- func FindSpinnakerService(c client.Client, ns string, builder interfaces.TypesFactory) (interfaces.SpinnakerService, error)
- func GetContainerInDeployment(dep *v12.Deployment, containerName string) *v1.Container
- func GetDesiredExposePort(ctx context.Context, svcNameWithoutPrefix string, defaultPort int32, ...) int32
- func GetMountedSecretNameInDeployment(dep *v12.Deployment, containerName, path string) string
- func GetPort(aUrl string, defaultPort int32) int32
- func GetSecretConfigFromConfig(config generated.ServiceConfig, n string) *v1.Secret
- func GetSecretContent(c *rest.Config, namespace, name, key string) (string, error)
- func GetService(name string, namespace string, client client.Client) (*corev1.Service, error)
- func GetServiceAccountData(ctx context.Context, name, ns string, c client.Client) (string, string, error)
- func GetSpinnakerServices(list interfaces.SpinnakerServiceList, ns string, c client.Client) ([]interfaces.SpinnakerService, error)
- func IsServiceLike(svc1, svc2 string) bool
- func UpdateSecret(secret *v1.Secret, svc string, settings map[string]interface{}, ...) error
- type HttpMethod
- type HttpService
- type Ik8sLookup
- type K8sLookup
- func (l K8sLookup) GetPodsByDeployment(instance interfaces.SpinnakerService, deployment appsv1.Deployment) ([]v1.Pod, error)
- func (l K8sLookup) GetReplicaSetByPod(instance interfaces.SpinnakerService, pod v1.Pod) (*appsv1.ReplicaSet, error)
- func (l K8sLookup) GetSpinnakerDeployments(instance interfaces.SpinnakerService) ([]appsv1.Deployment, error)
- func (l K8sLookup) GetSpinnakerServiceImageFromDeployment(p v1.PodSpec) string
- func (l K8sLookup) HasExceededMaxWaitingTime(instance interfaces.SpinnakerService, pod v1.Pod) (bool, error)
- type MockIk8sLookup
- func (m *MockIk8sLookup) EXPECT() *MockIk8sLookupMockRecorder
- func (m *MockIk8sLookup) GetPodsByDeployment(instance interfaces.SpinnakerService, deployment v1.Deployment) ([]v10.Pod, error)
- func (m *MockIk8sLookup) GetReplicaSetByPod(instance interfaces.SpinnakerService, pod v10.Pod) (*v1.ReplicaSet, error)
- func (m *MockIk8sLookup) GetSpinnakerDeployments(instance interfaces.SpinnakerService) ([]v1.Deployment, error)
- func (m *MockIk8sLookup) GetSpinnakerServiceImageFromDeployment(p v10.PodSpec) string
- func (m *MockIk8sLookup) HasExceededMaxWaitingTime(instance interfaces.SpinnakerService, pod v10.Pod) (bool, error)
- type MockIk8sLookupMockRecorder
- func (mr *MockIk8sLookupMockRecorder) GetPodsByDeployment(instance, deployment interface{}) *gomock.Call
- func (mr *MockIk8sLookupMockRecorder) GetReplicaSetByPod(instance, pod interface{}) *gomock.Call
- func (mr *MockIk8sLookupMockRecorder) GetSpinnakerDeployments(instance interface{}) *gomock.Call
- func (mr *MockIk8sLookupMockRecorder) GetSpinnakerServiceImageFromDeployment(p interface{}) *gomock.Call
- func (mr *MockIk8sLookupMockRecorder) HasExceededMaxWaitingTime(instance, pod interface{}) *gomock.Call
Constants ¶
const ( GateServiceName = "spin-gate" GateX509ServiceName = "spin-gate-x509" GateX509PortName = "gate-x509" GateDefaultPort = int32(8084) GateOverrideBaseUrlProp = "security.apiSecurity.overrideBaseUrl" GateSSLEnabledProp = "security.apiSecurity.ssl.enabled" DeckServiceName = "spin-deck" DeckOverrideBaseUrlProp = "security.uiSecurity.overrideBaseUrl" DeckSSLEnabledProp = "security.uiSecurity.ssl.enabled" DeckDefaultPort = int32(9000) ClouddriverName = "clouddriver" )
const MaxChecksWaitingForSpinnakerStability = 1
Variables ¶
This section is empty.
Functions ¶
func AddEnvVarToDeployment ¶ added in v1.1.0
func AddEnvVarToDeployment(d *appsv1.Deployment, e v1.EnvVar, merge func(old, new string) string, filter func(c v1.Container) bool)
AddEnvVarToDeployment adds an environment variable to the given deployment containers for which the filter function returns true. merge is used to indicate how to merge the value with an already existing value for the env var.
func BuildUrl ¶
BuildUrl builds a well formed url that only specifies the port if not derived by scheme already
func CreateOrUpdateService ¶
func CreateOrUpdateService(svc *corev1.Service, rawClient *kubernetes.Clientset) error
func CreateOrUpdateValidatingWebhookConfiguration ¶
func CreateOrUpdateValidatingWebhookConfiguration(config *v1beta1.ValidatingWebhookConfiguration, rawClient *kubernetes.Clientset) error
func FindDeployment ¶
func FindDeployment(c client.Client, spinsvc interfaces.SpinnakerService, service string) (*v12.Deployment, error)
func FindLoadBalancerUrl ¶
func FindSecretInDeployment ¶
func FindSpinnakerService ¶
func FindSpinnakerService(c client.Client, ns string, builder interfaces.TypesFactory) (interfaces.SpinnakerService, error)
func GetContainerInDeployment ¶
func GetContainerInDeployment(dep *v12.Deployment, containerName string) *v1.Container
func GetDesiredExposePort ¶
func GetDesiredExposePort(ctx context.Context, svcNameWithoutPrefix string, defaultPort int32, spinSvc interfaces.SpinnakerService) int32
GetDesiredExposePort returns the expected public port to have for the given service, according to halyard and expose configurations
func GetMountedSecretNameInDeployment ¶
func GetMountedSecretNameInDeployment(dep *v12.Deployment, containerName, path string) string
func GetSecretConfigFromConfig ¶ added in v0.4.0
func GetSecretConfigFromConfig(config generated.ServiceConfig, n string) *v1.Secret
func GetSecretContent ¶
func GetService ¶
func GetServiceAccountData ¶
func GetServiceAccountData(ctx context.Context, name, ns string, c client.Client) (string, string, error)
GetServiceAccountData returns the service account token and temp path to root ca
func GetSpinnakerServices ¶
func GetSpinnakerServices(list interfaces.SpinnakerServiceList, ns string, c client.Client) ([]interfaces.SpinnakerService, error)
func IsServiceLike ¶ added in v1.0.3
Types ¶
type HttpMethod ¶ added in v0.6.0
type HttpMethod string
const ( GET HttpMethod = "GET" POST HttpMethod = "POST" PUT HttpMethod = "PUT" DELETE HttpMethod = "DELETE" )
type HttpService ¶ added in v0.6.0
type HttpService struct { }
func (*HttpService) ParseResponseBody ¶ added in v0.6.0
func (s *HttpService) ParseResponseBody(body io.ReadCloser) ([]byte, error)
type Ik8sLookup ¶ added in v1.1.2
type Ik8sLookup interface { GetSpinnakerDeployments(instance interfaces.SpinnakerService) ([]appsv1.Deployment, error) GetSpinnakerServiceImageFromDeployment(p v1.PodSpec) string GetPodsByDeployment(instance interfaces.SpinnakerService, deployment appsv1.Deployment) ([]v1.Pod, error) GetReplicaSetByPod(instance interfaces.SpinnakerService, pod v1.Pod) (*appsv1.ReplicaSet, error) HasExceededMaxWaitingTime(instance interfaces.SpinnakerService, pod v1.Pod) (bool, error) }
type K8sLookup ¶ added in v1.1.2
type K8sLookup struct {
// contains filtered or unexported fields
}
func NewK8sLookup ¶ added in v1.1.2
func (K8sLookup) GetPodsByDeployment ¶ added in v1.1.2
func (l K8sLookup) GetPodsByDeployment(instance interfaces.SpinnakerService, deployment appsv1.Deployment) ([]v1.Pod, error)
GetPodsByDeployment returns the list of pods that belongs to a deployment
func (K8sLookup) GetReplicaSetByPod ¶ added in v1.1.2
func (l K8sLookup) GetReplicaSetByPod(instance interfaces.SpinnakerService, pod v1.Pod) (*appsv1.ReplicaSet, error)
GetReplicaSetByPod returns the replica set that belongs to a pod
func (K8sLookup) GetSpinnakerDeployments ¶ added in v1.1.2
func (l K8sLookup) GetSpinnakerDeployments(instance interfaces.SpinnakerService) ([]appsv1.Deployment, error)
getSpinnakerServices returns the name of the image
func (K8sLookup) GetSpinnakerServiceImageFromDeployment ¶ added in v1.1.2
getSpinnakerServiceImageFromDeployment returns the name of the image
func (K8sLookup) HasExceededMaxWaitingTime ¶ added in v1.1.2
func (l K8sLookup) HasExceededMaxWaitingTime(instance interfaces.SpinnakerService, pod v1.Pod) (bool, error)
hasExceededMaxWaitingTime validate if a replicaset has exceeded max waiting time
type MockIk8sLookup ¶ added in v1.1.2
type MockIk8sLookup struct {
// contains filtered or unexported fields
}
MockIk8sLookup is a mock of Ik8sLookup interface
func NewMockIk8sLookup ¶ added in v1.1.2
func NewMockIk8sLookup(ctrl *gomock.Controller) *MockIk8sLookup
NewMockIk8sLookup creates a new mock instance
func (*MockIk8sLookup) EXPECT ¶ added in v1.1.2
func (m *MockIk8sLookup) EXPECT() *MockIk8sLookupMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockIk8sLookup) GetPodsByDeployment ¶ added in v1.1.2
func (m *MockIk8sLookup) GetPodsByDeployment(instance interfaces.SpinnakerService, deployment v1.Deployment) ([]v10.Pod, error)
GetPodsByDeployment mocks base method
func (*MockIk8sLookup) GetReplicaSetByPod ¶ added in v1.1.2
func (m *MockIk8sLookup) GetReplicaSetByPod(instance interfaces.SpinnakerService, pod v10.Pod) (*v1.ReplicaSet, error)
GetReplicaSetByPod mocks base method
func (*MockIk8sLookup) GetSpinnakerDeployments ¶ added in v1.1.2
func (m *MockIk8sLookup) GetSpinnakerDeployments(instance interfaces.SpinnakerService) ([]v1.Deployment, error)
GetSpinnakerDeployments mocks base method
func (*MockIk8sLookup) GetSpinnakerServiceImageFromDeployment ¶ added in v1.1.2
func (m *MockIk8sLookup) GetSpinnakerServiceImageFromDeployment(p v10.PodSpec) string
GetSpinnakerServiceImageFromDeployment mocks base method
func (*MockIk8sLookup) HasExceededMaxWaitingTime ¶ added in v1.1.2
func (m *MockIk8sLookup) HasExceededMaxWaitingTime(instance interfaces.SpinnakerService, pod v10.Pod) (bool, error)
HasExceededMaxWaitingTime mocks base method
type MockIk8sLookupMockRecorder ¶ added in v1.1.2
type MockIk8sLookupMockRecorder struct {
// contains filtered or unexported fields
}
MockIk8sLookupMockRecorder is the mock recorder for MockIk8sLookup
func (*MockIk8sLookupMockRecorder) GetPodsByDeployment ¶ added in v1.1.2
func (mr *MockIk8sLookupMockRecorder) GetPodsByDeployment(instance, deployment interface{}) *gomock.Call
GetPodsByDeployment indicates an expected call of GetPodsByDeployment
func (*MockIk8sLookupMockRecorder) GetReplicaSetByPod ¶ added in v1.1.2
func (mr *MockIk8sLookupMockRecorder) GetReplicaSetByPod(instance, pod interface{}) *gomock.Call
GetReplicaSetByPod indicates an expected call of GetReplicaSetByPod
func (*MockIk8sLookupMockRecorder) GetSpinnakerDeployments ¶ added in v1.1.2
func (mr *MockIk8sLookupMockRecorder) GetSpinnakerDeployments(instance interface{}) *gomock.Call
GetSpinnakerDeployments indicates an expected call of GetSpinnakerDeployments
func (*MockIk8sLookupMockRecorder) GetSpinnakerServiceImageFromDeployment ¶ added in v1.1.2
func (mr *MockIk8sLookupMockRecorder) GetSpinnakerServiceImageFromDeployment(p interface{}) *gomock.Call
GetSpinnakerServiceImageFromDeployment indicates an expected call of GetSpinnakerServiceImageFromDeployment
func (*MockIk8sLookupMockRecorder) HasExceededMaxWaitingTime ¶ added in v1.1.2
func (mr *MockIk8sLookupMockRecorder) HasExceededMaxWaitingTime(instance, pod interface{}) *gomock.Call
HasExceededMaxWaitingTime indicates an expected call of HasExceededMaxWaitingTime