util

package
v0.0.0-...-3e41b37 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestLeaseDurationSeconds = 1
	TestDir                  = "/tmp/registration-integration-test"
)

Variables

View Source
var (
	CertDir        = path.Join(TestDir, "server-certs")
	CAFile         = path.Join(CertDir, "ca.crt")
	CAKeyFile      = path.Join(CertDir, "ca.key")
	ServerCertFile = path.Join(CertDir, "apiserver.crt")
	ServerKeyFile  = path.Join(CertDir, "apiserver.key")
)

Functions

func AcceptManagedCluster

func AcceptManagedCluster(clusterClient clusterclientset.Interface, spokeClusterName string) error

func ApproveCSR

func ApproveCSR(kubeClient kubernetes.Interface, csr *certificates.CertificateSigningRequest, notBefore, notAfter time.Time) error

func ApproveSpokeClusterCSR

func ApproveSpokeClusterCSR(kubeClient kubernetes.Interface, spokeClusterName string, certAge time.Duration) error

func ApproveSpokeClusterCSRWithExpiredCert

func ApproveSpokeClusterCSRWithExpiredCert(kubeClient kubernetes.Interface, spokeClusterName string) error

func CreateBootstrapKubeConfig

func CreateBootstrapKubeConfig(configFileName string, securePort int) error

func CreateBootstrapKubeConfigWithCertAge

func CreateBootstrapKubeConfigWithCertAge(configFileName string, securePort int, certAge time.Duration) error

func CreateSpokeKubeConfig

func CreateSpokeKubeConfig(restConfig *rest.Config, securePort int) (*rest.Config, error)

func FindAddOnCSRs

func FindAddOnCSRs(kubeClient kubernetes.Interface, spokeClusterName, addOnName string) ([]*certificates.CertificateSigningRequest, error)

func FindAutoApprovedSpokeCSR

func FindAutoApprovedSpokeCSR(kubeClient kubernetes.Interface, spokeClusterName string) (*certificates.CertificateSigningRequest, error)

func FindUnapprovedAddOnCSR

func FindUnapprovedAddOnCSR(kubeClient kubernetes.Interface, spokeClusterName, addOnName string) (*certificates.CertificateSigningRequest, error)

func FindUnapprovedSpokeCSR

func FindUnapprovedSpokeCSR(kubeClient kubernetes.Interface, spokeClusterName string) (*certificates.CertificateSigningRequest, error)

func GenerateSelfSignedCertKey

func GenerateSelfSignedCertKey() error

func GetFilledHubKubeConfigSecret

func GetFilledHubKubeConfigSecret(kubeClient kubernetes.Interface, secretNamespace, secretName string) (*corev1.Secret, error)

func GetManagedCluster

func GetManagedCluster(clusterClient clusterclientset.Interface, spokeClusterName string) (*clusterv1.ManagedCluster, error)

func NewIntegrationTestEventRecorder

func NewIntegrationTestEventRecorder(componet string) events.Recorder

func PrepareSpokeAgentNamespace

func PrepareSpokeAgentNamespace(kubeClient kubernetes.Interface, namespace string) error

func SignAPIServerCertKeyWithCA

func SignAPIServerCertKeyWithCA(maxAge time.Duration) ([]byte, []byte, error)

Types

type IntegrationTestEventRecorder

type IntegrationTestEventRecorder struct {
	// contains filtered or unexported fields
}

func (*IntegrationTestEventRecorder) ComponentName

func (r *IntegrationTestEventRecorder) ComponentName() string

func (*IntegrationTestEventRecorder) Event

func (r *IntegrationTestEventRecorder) Event(reason, message string)

func (*IntegrationTestEventRecorder) Eventf

func (r *IntegrationTestEventRecorder) Eventf(reason, messageFmt string, args ...interface{})

func (*IntegrationTestEventRecorder) ForComponent

func (*IntegrationTestEventRecorder) Shutdown

func (r *IntegrationTestEventRecorder) Shutdown()

func (*IntegrationTestEventRecorder) Warning

func (r *IntegrationTestEventRecorder) Warning(reason, message string)

func (*IntegrationTestEventRecorder) Warningf

func (r *IntegrationTestEventRecorder) Warningf(reason, messageFmt string, args ...interface{})

func (*IntegrationTestEventRecorder) WithComponentSuffix

func (r *IntegrationTestEventRecorder) WithComponentSuffix(suffix string) events.Recorder

Jump to

Keyboard shortcuts

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