Documentation ¶
Index ¶
- Constants
- func AssertEmpty(t *testing.T, object interface{}, message string)
- func AssertEqual(t *testing.T, a interface{}, b interface{}, message string)
- func AssertError(t *testing.T, err error, expected string)
- func AssertNoError(t *testing.T, err error)
- func OpenIptables() error
- func OpenIptablesForProtocol(protocol string) error
- func UseGcpTokenForImage(image string) bool
- func WriteWelcomeScript(startupErr interface{}) error
- type AuthProvider
- type ConstantTokenProvider
- type FileWriterInterface
- type LoggerInterface
- type RealFileWriter
- type RealLogger
- type ServiceAccountTokenProvider
- type Token
Constants ¶
View Source
const AUTH_METADATA = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token"
View Source
const SCRIPT_PATH = "/host/etc/profile.d/gce-containers-welcome.sh"
View Source
const WELCOME_SCRIPT_ON_FAILURE = `` /* 546-byte string literal not displayed */
View Source
const WELCOME_SCRIPT_ON_SUCCESS = `` /* 457-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AssertEmpty ¶
func AssertEqual ¶
func AssertNoError ¶
func OpenIptables ¶
func OpenIptables() error
func OpenIptablesForProtocol ¶
func UseGcpTokenForImage ¶
UseGcpTokenForImage returns true iff the provided image string points to a repository that uses a GCP token. Currently, that is:
- gcr.io
- pkg.dev
func WriteWelcomeScript ¶
func WriteWelcomeScript(startupErr interface{}) error
Types ¶
type AuthProvider ¶
type ConstantTokenProvider ¶
type ConstantTokenProvider struct {
Token string
}
func (ConstantTokenProvider) RetrieveAuthToken ¶
func (provider ConstantTokenProvider) RetrieveAuthToken() (string, error)
type FileWriterInterface ¶
type LoggerInterface ¶
type LoggerInterface interface {
Print(v ...interface{})
}
type RealFileWriter ¶
type RealFileWriter struct{}
type RealLogger ¶
type RealLogger struct{}
func (RealLogger) Print ¶
func (_ RealLogger) Print(v ...interface{})
type ServiceAccountTokenProvider ¶
type ServiceAccountTokenProvider struct { }
func (ServiceAccountTokenProvider) RetrieveAuthToken ¶
func (provider ServiceAccountTokenProvider) RetrieveAuthToken() (string, error)
Click to show internal directories.
Click to hide internal directories.