bundlereader

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Overview

Package bundlereader creates a bundle from a source and adds all the referenced resources, as well as image scans.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChartVersion added in v0.12.0

func ChartVersion(location fleet.HelmOptions, a Auth) (string, error)

ChartVersion returns the version of the helm chart from a helm repo server, by inspecting the repo's index.yaml

func GetContent

func GetContent(ctx context.Context, base, source, version string, auth Auth, disableDepsUpdate bool, ignoreApplyConfigs []string) (map[string][]byte, error)

GetContent uses go-getter (and Helm for OCI) to read the files from directories and servers.

func GetManifestFromHelmChart added in v0.12.0

func GetManifestFromHelmChart(ctx context.Context, c client.Reader, bd *fleet.BundleDeployment) (*manifest.Manifest, error)

GetManifestFromHelmChart downloads the given helm chart and creates a manifest with its contents. This is used by the agent to deploy HelmOps.

func GetOCITag added in v0.13.1

func GetOCITag(r *remote.Repository, v string) (string, error)

GetOCITag fetches the highest available tag matching version v in repository r. Returns an error if the remote repository itself returns an error, for instance if the OCI repository is not found. If no error is returned, it is the caller's responsibility to check that the returned tag is non-empty.

func NewBundle added in v0.13.0

func NewBundle(ctx context.Context, name, baseDir, file string, opts *Options) (*fleet.Bundle, []*fleet.ImageScan, error)

NewBundle reads the fleet.yaml, from stdin, or basedir, or a file in basedir. Then it reads/downloads all referenced resources. It returns the populated bundle and any existing imagescans.

Types

type Auth

type Auth struct {
	Username           string `json:"username,omitempty"`
	Password           string `json:"password,omitempty"`
	CABundle           []byte `json:"caBundle,omitempty"`
	SSHPrivateKey      []byte `json:"sshPrivateKey,omitempty"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify,omitempty"`
	BasicHTTP          bool   `json:"basicHTTP,omitempty"`
}

func ReadHelmAuthFromSecret added in v0.12.0

func ReadHelmAuthFromSecret(ctx context.Context, c client.Reader, req types.NamespacedName) (Auth, error)

type Options

type Options struct {
	Compress         bool
	Labels           map[string]string
	ServiceAccount   string
	TargetsFile      string
	TargetNamespace  string
	Paused           bool
	SyncGeneration   int64
	Auth             Auth
	HelmRepoURLRegex string
	KeepResources    bool
	DeleteNamespace  bool
	CorrectDrift     *fleet.CorrectDrift
}

Options include the GitRepo overrides, which are passed via command line args

type Style

type Style struct {
	ChartPath     string
	KustomizePath string
	HasChartYAML  bool
	Options       fleet.BundleDeploymentOptions
}

func DetermineStyle

func DetermineStyle(m *manifest.Manifest, options fleet.BundleDeploymentOptions) Style

func (Style) IsHelm

func (s Style) IsHelm() bool

func (Style) IsKustomize

func (s Style) IsKustomize() bool

func (Style) IsRawYAML

func (s Style) IsRawYAML() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL