util

package
v1.0.3-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GateServiceName         = "spin-gate"
	GateX509ServiceName     = "spin-gate-x509"
	GateX509PortName        = "gate-x509"
	GateOverrideBaseUrlProp = "security.apiSecurity.overrideBaseUrl"
	GateSSLEnabledProp      = "security.apiSecurity.ssl.enabled"
	DeckServiceName         = "spin-deck"
	DeckOverrideBaseUrlProp = "security.uiSecurity.overrideBaseUrl"
	DeckSSLEnabledProp      = "security.uiSecurity.ssl.enabled"
	ClouddriverName         = "clouddriver"
)

Variables

This section is empty.

Functions

func BuildUrl

func BuildUrl(scheme string, hostWithoutPort string, port int32) string

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 FindLoadBalancerUrl(svcName string, namespace string, client client.Client, hcSSLEnabled bool) (string, error)

func FindSecretInDeployment

func FindSecretInDeployment(c client.Client, dep *v12.Deployment, containerName, path string) (*v1.Secret, 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 GetPort

func GetPort(aUrl string, defaultPort int32) int32

func GetSecretConfigFromConfig added in v0.4.0

func GetSecretConfigFromConfig(config generated.ServiceConfig, n string) *v1.Secret

func GetSecretContent

func GetSecretContent(c *rest.Config, namespace, name, key string) (string, error)

func GetService

func GetService(name string, namespace string, client client.Client) (*corev1.Service, error)

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 IsServiceLike added in v1.0.3

func IsServiceLike(svc1, svc2 string) bool

func UpdateSecret

func UpdateSecret(secret *v1.Secret, svc string, settings map[string]interface{}, profileName string) error

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) Execute added in v0.6.0

func (s *HttpService) Execute(ctx context.Context, req *http.Request) (*http.Response, error)

func (*HttpService) ParseResponseBody added in v0.6.0

func (s *HttpService) ParseResponseBody(body io.ReadCloser) ([]byte, error)

func (*HttpService) Request added in v0.6.0

func (s *HttpService) Request(ctx context.Context, method HttpMethod, url string, requestParams map[string]string, headers map[string]string, body io.Reader) (*http.Request, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL