Documentation ¶
Index ¶
- Constants
- func CreateNamespace(ctx context.Context, kubeClient client.Client, name string, ...) error
- func CreateOrUpdateNamespace(ctx context.Context, kubeClient client.Client, name string, ...) error
- func DumpJSON(o interface{}) string
- func IsValidURL(strURL string) bool
- func ParseAPIServerEndpoint(server string) (string, error)
- func RandomString(n int) string
- func Sanitize(s string) string
- func StrictUnmarshal(bs []byte, dest interface{}) error
- func StringsContain(items []string, source string) bool
- func UpdateNamespace(ctx context.Context, kubeClient client.Client, name string, ...) error
- type Content
- type GithubContent
- type LocalContent
- type MutateOption
- type OssContent
Constants ¶
const TypeGithub = "github"
TypeGithub represents github
const TypeLocal = "local"
TypeLocal represents github
const TypeOss = "oss"
TypeOss represent oss
const TypeUnknown = "unknown"
TypeUnknown represents parse failed
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
func CreateNamespace(ctx context.Context, kubeClient client.Client, name string, options ...MutateOption) error
CreateNamespace will create a namespace with mutate option
func CreateOrUpdateNamespace ¶
func CreateOrUpdateNamespace(ctx context.Context, kubeClient client.Client, name string, options ...MutateOption) error
CreateOrUpdateNamespace will create a namespace if not exist, it will also update a namespace if exists It will report an error if the labels conflict while it will override the annotations
func IsValidURL ¶
IsValidURL checks whether the given string is a valid URL or not
func ParseAPIServerEndpoint ¶
ParseAPIServerEndpoint automatically construct the full url of APIServer It will patch port and scheme if not exists
func StrictUnmarshal ¶
StrictUnmarshal unmarshal target structure and disallow unknown fields
func StringsContain ¶
StringsContain strings contain
func UpdateNamespace ¶
func UpdateNamespace(ctx context.Context, kubeClient client.Client, name string, options ...MutateOption) error
UpdateNamespace will update a namespace with mutate option
Types ¶
type Content ¶
type Content struct { OssContent GithubContent LocalContent }
Content contains different type of content needed when building Registry
type GithubContent ¶
type GithubContent struct { Owner string `json:"owner"` Repo string `json:"repo"` Path string `json:"path"` Ref string `json:"ref"` }
GithubContent for cap center
type LocalContent ¶
type LocalContent struct {
AbsDir string `json:"abs_dir"`
}
LocalContent for local registry
type MutateOption ¶
MutateOption defines the function pattern for mutate
func MergeNoConflictLabels ¶
func MergeNoConflictLabels(labels map[string]string) MutateOption
MergeNoConflictLabels will merge the existing labels with the labels passed in, it will report conflicts if exists
func MergeOverrideAnnotations ¶
func MergeOverrideAnnotations(annotations map[string]string) MutateOption
MergeOverrideAnnotations will merge the existing annotations and override by the annotations passed in
func MergeOverrideLabels ¶
func MergeOverrideLabels(labels map[string]string) MutateOption
MergeOverrideLabels will merge the existing labels and override by the labels passed in
type OssContent ¶
OssContent for oss registry