Documentation
¶
Index ¶
- Constants
- Variables
- func AppNamespace() string
- func Base64DecodeInterface(d interface{}) ([]byte, error)
- func CommonSlicePrefix(first []string, second []string) []string
- func CompareStringArrays(arr1, arr2 []string) bool
- func ConvertToSingleDocs(doc []byte) [][]byte
- func DecryptConfigValue(input string) (string, error)
- func DefaultProxyRegistryDomain() string
- func DefaultReplicatedRegistryDomain() string
- func EmbeddedClusterDataDir() string
- func EmbeddedClusterID() string
- func EmbeddedClusterK0sDir() string
- func EmbeddedClusterVersion() string
- func ExtractReadableText(data []byte) string
- func ExtractTGZArchive(tgzFile string, destDir string) error
- func FilesToTGZ(files map[string]string) ([]byte, error)
- func GenPassword(length int) string
- func GetFileFromTGZArchive(archive *bytes.Buffer, fileName string) (*bytes.Buffer, error)
- func GetFilesMap(dir string) (map[string][]byte, error)
- func GetValueFromMapPath(m interface{}, path []string) interface{}
- func GunzipData(input []byte) ([]byte, error)
- func GzipData(input []byte) ([]byte, error)
- func HTTPProxy() string
- func HTTPSProxy() string
- func HomeDir() string
- func IntPointer(x int) *int64
- func IsEmbeddedCluster() bool
- func IsURL(str string) bool
- func IsUpgradeService() bool
- func MarshalIndent(indent int, in interface{}) ([]byte, error)
- func NewRequest(method string, url string, body io.Reader) (*http.Request, error)
- func NewRetryableRequest(method string, url string, body io.Reader) (*retryablehttp.Request, error)
- func NewThrottle(after time.Duration) func(f func())
- func NoProxy() string
- func PromptForNewPassword() (string, error)
- func ReplicatedAppEndpoint(license *kotsv1beta1.License) string
- func SplitStringOnLen(str string, maxLength int) ([]string, error)
- func SplitYAML(input []byte) (map[string][]byte, error)
- func StrPointer(s string) *string
- func TGZArchive(dir string) ([]byte, error)
- func TGZToFiles(tgzBytes []byte) (map[string]string, error)
- func TestGetenv(key string) string
- func ThisImage(ctx context.Context, client kubernetes.Interface) (string, error)
- type ActionableError
- type CachingReader
- type OverlySimpleGVK
- type OverlySimpleMetadata
Constants ¶
const ( PasswordSecretName = "kotsadm-password" SessionsSecretName = "kotsadm-sessions" )
Variables ¶
var ( PodNamespace string = os.Getenv("POD_NAMESPACE") KotsadmTargetNamespace string = os.Getenv("KOTSADM_TARGET_NAMESPACE") )
var DefaultHTTPClient *retryablehttp.Client
Functions ¶
func AppNamespace ¶
func AppNamespace() string
func Base64DecodeInterface ¶ added in v1.82.0
func CommonSlicePrefix ¶
func CompareStringArrays ¶
CompareStringArrays returns true if all elements in arr1 are present in arr2 and the other way around. it does not check for equal counts of duplicates, or for ordering.
func ConvertToSingleDocs ¶
func DecryptConfigValue ¶ added in v1.98.0
func DefaultProxyRegistryDomain ¶ added in v1.124.6
func DefaultProxyRegistryDomain() string
func DefaultReplicatedRegistryDomain ¶ added in v1.124.6
func DefaultReplicatedRegistryDomain() string
func EmbeddedClusterDataDir ¶ added in v1.124.17
func EmbeddedClusterDataDir() string
func EmbeddedClusterID ¶ added in v1.108.11
func EmbeddedClusterID() string
func EmbeddedClusterK0sDir ¶ added in v1.124.17
func EmbeddedClusterK0sDir() string
func EmbeddedClusterVersion ¶ added in v1.109.10
func EmbeddedClusterVersion() string
func ExtractReadableText ¶ added in v1.124.11
ExtractReadableText takes potentially binary data and extracts human-readable portions to help with debugging. It tries to preserve meaningful text sections while replacing binary sections with "..." placeholders.
func ExtractTGZArchive ¶
func GenPassword ¶
generates a [0-9a-zA-Z] password of the specified length
func GetFileFromTGZArchive ¶ added in v1.84.0
func GetValueFromMapPath ¶ added in v1.82.0
func GetValueFromMapPath(m interface{}, path []string) interface{}
func GunzipData ¶ added in v1.104.0
func HTTPSProxy ¶ added in v1.109.11
func HTTPSProxy() string
func IntPointer ¶
func IsEmbeddedCluster ¶ added in v1.107.0
func IsEmbeddedCluster() bool
func IsUpgradeService ¶ added in v1.112.0
func IsUpgradeService() bool
func MarshalIndent ¶
func NewRequest ¶
NewRequest returns a http.Request object with kots defaults set, including a User-Agent header.
func NewRetryableRequest ¶ added in v1.124.17
NewRetryableRequest returns a retryablehttp.Request object with kots defaults set, including a User-Agent header.
func NewThrottle ¶
func PromptForNewPassword ¶ added in v1.91.0
func ReplicatedAppEndpoint ¶ added in v1.124.8
func ReplicatedAppEndpoint(license *kotsv1beta1.License) string
ReplicatedAPIEndpoint returns the endpoint for the replicated.app API.
func StrPointer ¶ added in v1.91.2
func TGZArchive ¶ added in v1.96.0
func TestGetenv ¶
Types ¶
type ActionableError ¶
func (ActionableError) Error ¶
func (e ActionableError) Error() string
type CachingReader ¶ added in v1.124.11
type CachingReader struct {
// contains filtered or unexported fields
}
CachingReader is a reader that caches the last N bytes read to help with debugging when encountering errors in tar or gzip extraction
func NewCachingReader ¶ added in v1.124.11
func NewCachingReader(r io.Reader, size int) *CachingReader
NewCachingReader creates a new caching reader that caches the last size bytes
func (*CachingReader) GetCachedBytes ¶ added in v1.124.11
func (c *CachingReader) GetCachedBytes() []byte
GetCachedBytes returns the last bytes read up to size
func (*CachingReader) LogReadableText ¶ added in v1.124.11
func (c *CachingReader) LogReadableText(message string)
type OverlySimpleGVK ¶ added in v1.98.1
type OverlySimpleGVK struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata OverlySimpleMetadata `yaml:"metadata"` }