Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCluster(t *testing.T, expected, actual *capi.Cluster)
- func CheckConfigMap(t *testing.T, expected, actual *corev1.ConfigMap)
- func CheckError(t *testing.T, expectError bool, err error)
- func CheckK8sServers(t *testing.T, expected, actual []types.KubeServer)
- func CheckSecret(t *testing.T, expected, actual *corev1.Secret)
- func CheckToken(t *testing.T, expected, actual types.ProvisionToken)
- func CheckTokens(t *testing.T, expected, actual []types.ProvisionToken)
- func NewCluster(name, namespace string, finalizers []string, deletionTimestamp time.Time) *capi.Cluster
- func NewConfigMap(clusterName, appName, namespaceName, tokenName string) *corev1.ConfigMap
- func NewFakeK8sClient(runtimeObjects []runtime.Object) (client.Client, error)
- func NewIdentitySecret(namespaceName, identityFile string) *corev1.Secret
- func NewKubeServer(clusterName, hostId, hostName string) teleportTypes.KubeServer
- func NewMockTokenGenerator(token string) token.Generator
- func NewSecret(clusterName, namespaceName, tokenName string) *corev1.Secret
- func NewToken(tokenName, clusterName, tokenType string) teleportTypes.ProvisionToken
- func ObjectKeyFromObjectMeta(objectMeta metav1.ObjectMeta) client.ObjectKey
- type FakeTeleportClient
- func (c *FakeTeleportClient) CreateToken(ctx context.Context, token types.ProvisionToken) error
- func (c *FakeTeleportClient) DeleteToken(ctx context.Context, name string) error
- func (c *FakeTeleportClient) GetToken(ctx context.Context, name string) (types.ProvisionToken, error)
- func (c *FakeTeleportClient) GetTokens(ctx context.Context) ([]types.ProvisionToken, error)
- func (c *FakeTeleportClient) Ping(ctx context.Context) (proto.PingResponse, error)
- func (c *FakeTeleportClient) UpsertToken(ctx context.Context, token types.ProvisionToken) error
- type FakeTeleportClientConfig
- type MockTokenGenerator
Constants ¶
View Source
const ( TokenName = "oldTokenWithLengthOf32Characters" NewTokenName = "newTokenWithLengthOf32Characters" ClusterName = "test-cluster" AppName = "app-name" NamespaceName = "test-namespace" ClusterKey = "cluster" TokenTypeKey = "type" JoinTokenKey = "joinToken" TokenTypeKube = "kube" TokenTypeNode = "node" AppCatalog = "app-catalog" AppVersion = "appVersion" ManagementClusterName = "management-cluster" ProxyAddr = "127.0.0.1" IdentityFileValue = "identity-file-value" TeleportVersion = "1.0.0" ConfigMapValuesFormat = "authToken: %s\nproxyAddr: %s\nroles: kube\nkubeClusterName: %s\nteleportVersionOverride: %s" )
Variables ¶
View Source
var LastReadValue = time.Now()
Functions ¶
func CheckK8sServers ¶
func CheckK8sServers(t *testing.T, expected, actual []types.KubeServer)
func CheckToken ¶
func CheckToken(t *testing.T, expected, actual types.ProvisionToken)
func CheckTokens ¶
func CheckTokens(t *testing.T, expected, actual []types.ProvisionToken)
func NewCluster ¶
func NewConfigMap ¶
func NewFakeK8sClient ¶
func NewIdentitySecret ¶ added in v0.6.0
func NewKubeServer ¶
func NewKubeServer(clusterName, hostId, hostName string) teleportTypes.KubeServer
func NewMockTokenGenerator ¶
func NewToken ¶
func NewToken(tokenName, clusterName, tokenType string) teleportTypes.ProvisionToken
func ObjectKeyFromObjectMeta ¶
func ObjectKeyFromObjectMeta(objectMeta metav1.ObjectMeta) client.ObjectKey
Types ¶
type FakeTeleportClient ¶
type FakeTeleportClient struct {
// contains filtered or unexported fields
}
func NewTeleportClient ¶
func NewTeleportClient(config FakeTeleportClientConfig) *FakeTeleportClient
func (*FakeTeleportClient) CreateToken ¶
func (c *FakeTeleportClient) CreateToken(ctx context.Context, token types.ProvisionToken) error
func (*FakeTeleportClient) DeleteToken ¶
func (c *FakeTeleportClient) DeleteToken(ctx context.Context, name string) error
func (*FakeTeleportClient) GetToken ¶
func (c *FakeTeleportClient) GetToken(ctx context.Context, name string) (types.ProvisionToken, error)
func (*FakeTeleportClient) GetTokens ¶
func (c *FakeTeleportClient) GetTokens(ctx context.Context) ([]types.ProvisionToken, error)
func (*FakeTeleportClient) Ping ¶
func (c *FakeTeleportClient) Ping(ctx context.Context) (proto.PingResponse, error)
func (*FakeTeleportClient) UpsertToken ¶
func (c *FakeTeleportClient) UpsertToken(ctx context.Context, token types.ProvisionToken) error
type MockTokenGenerator ¶
type MockTokenGenerator struct {
// contains filtered or unexported fields
}
func (*MockTokenGenerator) Generate ¶
func (g *MockTokenGenerator) Generate() string
Click to show internal directories.
Click to hide internal directories.