Documentation
¶
Index ¶
- Constants
- func BuildResource(tmpl *apix.JSON, inputs map[string]any) (*unstructured.Unstructured, error)
- func BuildResourceSet(yamlTemplate string, templates []*apix.JSON, inputs []map[string]any) ([]*unstructured.Unstructured, error)
- func BuildResourcesFromYAML(yamlTemplate string, inputs map[string]any) ([]*unstructured.Unstructured, error)
- func ContainElementString(s []string, e string) bool
- func GetArtifactDigest(ctx context.Context, ociURL string, keyChain authn.Keychain) (string, error)
- func GetMultitenantProfile(defaultSA string) string
- func GetNotificationPatch(namespace string) string
- func IsCompatibleVersion(fromVer, toVer string) error
- func MatchVersion(dataDir, semverRange string) (string, error)
- func MkdirTempAbs(dir, pattern string) (string, error)
- func PullArtifact(ctx context.Context, ociURL, dstDir string, keyChain authn.Keychain) (string, error)
- type ArtifactStorage
- type ComponentImage
- type Options
- type Result
- type Sync
Constants ¶
const ProfileOpenShift = `` /* 501-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BuildResource ¶ added in v0.14.0
func BuildResource(tmpl *apix.JSON, inputs map[string]any) (*unstructured.Unstructured, error)
BuildResource builds a Kubernetes resource from a JSON template using the provided inputs. Template functions are provided by the slim-sprig library https://go-task.github.io/slim-sprig/. In addition, the slugify function is available to generate slugs from strings using https://github.com/gosimple/slug/. And for readability, a toYaml function is available to encode an input value into a YAML string.
func BuildResourceSet ¶ added in v0.14.0
func BuildResourceSet(yamlTemplate string, templates []*apix.JSON, inputs []map[string]any) ([]*unstructured.Unstructured, error)
BuildResourceSet builds a list of Kubernetes resources from a list of JSON templates using the provided inputs.
func BuildResourcesFromYAML ¶ added in v0.14.0
func BuildResourcesFromYAML(yamlTemplate string, inputs map[string]any) ([]*unstructured.Unstructured, error)
BuildResourcesFromYAML builds a list of Kubernetes resources from a multi-doc YAML template using the same templating functions as BuildResource.
func ContainElementString ¶ added in v0.13.0
func GetArtifactDigest ¶ added in v0.12.0
GetArtifactDigest looks up an artifact from an OCI repository and returns the digest of the artifact.
func GetMultitenantProfile ¶ added in v0.7.0
func GetNotificationPatch ¶ added in v0.13.0
func IsCompatibleVersion ¶
IsCompatibleVersion checks if the version upgrade is compatible. It returns an error if a downgrade to a lower minor version is attempted.
func MatchVersion ¶
MatchVersion returns the latest version dir path that matches the given semver range.
func MkdirTempAbs ¶
MkdirTempAbs creates a tmp dir and returns the absolute path to the dir. This is required since certain OSes like MacOS create temporary files in e.g. `/private/var`, to which `/var` is a symlink.
func PullArtifact ¶ added in v0.5.0
func PullArtifact(ctx context.Context, ociURL, dstDir string, keyChain authn.Keychain) (string, error)
PullArtifact downloads an artifact from an OCI repository and extracts the content of the first tgz layer to the given destination directory. It returns the digest of the artifact.
Types ¶
type ArtifactStorage ¶ added in v0.2.0
ArtifactStorage represents the source-controller PVC.
type ComponentImage ¶ added in v0.1.0
ComponentImage represents a container image used by a component.
func ExtractComponentImages ¶ added in v0.1.0
func ExtractComponentImages(srcDir string, opts Options) ([]ComponentImage, error)
ExtractComponentImages reads the source directory and extracts the container images from the components manifests.
func ExtractComponentImagesWithDigest ¶ added in v0.5.0
func ExtractComponentImagesWithDigest(srcDir string, opts Options) (images []ComponentImage, err error)
ExtractComponentImagesWithDigest reads the source directory and extracts the container images with digest from the kustomize images patches.
type Options ¶
type Options struct { Version string Namespace string Components []string ComponentImages []ComponentImage EventsAddr string Registry string ImagePullSecret string WatchAllNamespaces bool NetworkPolicy bool LogLevel string NotificationController string ClusterDomain string TolerationKeys []string Patches string ArtifactStorage *ArtifactStorage Sync *Sync ShardingKey string Shards []string ShardName string }
Options defines the builder configuration.
func MakeDefaultOptions ¶
func MakeDefaultOptions() Options
MakeDefaultOptions returns the default builder configuration.
type Result ¶
type Result struct { Version string Digest string Revision string Objects []*unstructured.Unstructured ComponentImages []ComponentImage }
Result holds the build result.