Documentation
¶
Index ¶
- func CompareObjectMeta(left metav1.ObjectMeta, right metav1.ObjectMeta) bool
- func ComposePkgObjName(repoName, path, packageName string) string
- func ComposePkgRevObjName(repoName, path, packageName, workspace string) string
- func FilepathSafeJoin(dir, relative string) (string, error)
- func FindBestSemverMatch(constraint string, imageName string, cachedTags []string) (string, error)
- func GenerateUid(prefix string, kubeNs string, kubeName string) types.UID
- func GetImageName(image string) string
- func GetImageRepository(image string) string
- func GetImageTag(image string) string
- func GetInClusterNamespace() (string, error)
- func GetPRWorkspaceName(k8sName string) string
- func GetPorchApiServiceKey(ctx context.Context) (client.ObjectKey, error)
- func GetRepoPackageRefFromUpstream(upstream *kptfileapi.Upstream) (upstreamRepoSpec *configapi.RepositorySpec, ...)
- func ImageJoin(prefix, image string) string
- func RetryOnError(retries int, f func(retryNumber int) error) error
- func RetryOnErrorConditional(retries int, shouldRetryFunc func(error) bool, f func(retryNumber int) error) error
- func SafeReverse[S ~[]E, E any](s S)
- func SchemaToMetaGVR(gvr schema.GroupVersionResource) metav1.GroupVersionResource
- func SplitIn3OnDelimiter(splitee, delimiter string) []string
- func ValidPkgObjName(repoName, path, packageName string) error
- func ValidPkgRevObjName(repoName, path, packageName, workspace string) error
- func ValidateDirectoryName(directory string, mandatory bool) error
- func ValidateK8SName(k8sName string) error
- func ValidateRepository(repoName, directory string) error
- func ValidateResourcePaths(resources map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareObjectMeta ¶
func CompareObjectMeta(left metav1.ObjectMeta, right metav1.ObjectMeta) bool
func ComposePkgObjName ¶
func ComposePkgRevObjName ¶
func FilepathSafeJoin ¶ added in v1.5.12
FilepathSafeJoin joins dir and relative, returning an error if relative is not a clean, canonical relative path within dir. It rejects path traversal (.. sequences), absolute paths, the bare "." and ".." entries, and any path that would be altered by filepath.Clean (e.g. leading "./", redundant separators, or internal "a/../b" segments).
func FindBestSemverMatch ¶ added in v1.5.12
FindBestSemverMatch selects the highest semver tag from cachedTags that satisfies constraint. It returns the selected tag (e.g. "v1.2.3") for the given imageName (used for logging only).
func GetImageName ¶ added in v1.5.12
func GetImageRepository ¶ added in v1.5.12
func GetImageTag ¶ added in v1.5.12
func GetInClusterNamespace ¶
func GetPRWorkspaceName ¶
func GetPorchApiServiceKey ¶
func GetRepoPackageRefFromUpstream ¶ added in v1.5.12
func GetRepoPackageRefFromUpstream(upstream *kptfileapi.Upstream) (upstreamRepoSpec *configapi.RepositorySpec, upstreamPackage, upstreamRef string, isManagedReference bool, err error)
func RetryOnErrorConditional ¶
func RetryOnErrorConditional(retries int, shouldRetryFunc func(error) bool, f func(retryNumber int) error) error
RetryOnErrorConditional retries f up to retries times if it returns an error that matches shouldRetryFunc
func SafeReverse ¶
func SafeReverse[S ~[]E, E any](s S)
func SchemaToMetaGVR ¶
func SchemaToMetaGVR(gvr schema.GroupVersionResource) metav1.GroupVersionResource
func SplitIn3OnDelimiter ¶
func ValidPkgObjName ¶
func ValidPkgRevObjName ¶
func ValidateDirectoryName ¶
func ValidateK8SName ¶
func ValidateRepository ¶
func ValidateResourcePaths ¶ added in v1.5.12
ValidateResourcePaths checks that all keys in a resource map are valid relative file paths within a package. It rejects path traversal sequences, absolute paths, and non-canonical paths (e.g. leading "./", bare "." or ".."). Returns an error on the first invalid key.
Types ¶
This section is empty.