Documentation ¶
Index ¶
- Variables
- func IsRemote(name string) bool
- type Bundle
- func (b *Bundle) AddResource(res Resource)
- func (b *Bundle) Export(fs filesys.FileSystem, opts ...ExportOpts) error
- func (b *Bundle) FindByGVK(gvk GroupVersionKind) []*resource.Resource
- func (b *Bundle) Flatten(w io.Writer) error
- func (b *Bundle) FlattenSecure(recipients []string, w io.Writer) error
- func (b *Bundle) Resources() []Resource
- type BundleOpts
- type ExportOpts
- type GroupVersionKind
- type KustomizeModule
- func (m *KustomizeModule) Build(w io.Writer) error
- func (m *KustomizeModule) BuildEncrypted(data []byte, recipients []string) ([]byte, error)
- func (m *KustomizeModule) Bundle(opts ...BundleOpts) (*Bundle, error)
- func (m *KustomizeModule) Components() []string
- func (m *KustomizeModule) Host() string
- func (m *KustomizeModule) Name() string
- func (m *KustomizeModule) Namespace() string
- func (m *KustomizeModule) Ref() string
- func (m *KustomizeModule) Resolve() error
- func (m *KustomizeModule) Secrets() []Secret
- func (m *KustomizeModule) URL() string
- func (m *KustomizeModule) Version() string
- type Loader
- type Module
- type Resource
- type Secret
Constants ¶
This section is empty.
Variables ¶
var DefaultKustomizerOptions = &krusty.Options{ Reorder: krusty.ReorderOptionNone, AddManagedbyLabel: false, LoadRestrictions: ktypes.LoadRestrictionsNone, PluginConfig: ktypes.DisabledPluginConfig(), }
Functions ¶
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func NewBundle ¶
func NewBundle(m Module, opts ...BundleOpts) (*Bundle, error)
NewBundle returns a new Bundle for the given module and options provided
func (*Bundle) AddResource ¶
AddResource adds a resource to this bundle
func (*Bundle) Export ¶
func (b *Bundle) Export(fs filesys.FileSystem, opts ...ExportOpts) error
Export writes each resource in the bundle to individual yaml files on the provided filesystem. It effectivly runs resource.Flatten on each resource in this bundle. If a v1.Secret is encountered and a list of age recipient are known, then the resource is encrypted before writing to the file.
func (*Bundle) FindByGVK ¶
func (b *Bundle) FindByGVK(gvk GroupVersionKind) []*resource.Resource
FindByGVK attempts to find a resource with the specific kind group, version and kind specified in the provided GroupVersionKind paramter
func (*Bundle) FlattenSecure ¶
type BundleOpts ¶
func WithAgeRecipients ¶
func WithAgeRecipients(recipients []string) BundleOpts
WithAgeRecipients configures the bundle adding age recipients used for encryption
func WithResMap ¶
func WithResMap(rm resmap.ResMap) BundleOpts
func WithSecrets ¶
func WithSecrets(secrets []Secret) BundleOpts
WithSecrets applies all secrets defined in this module to the provided ResMap. Searches through the given resmap for Secret resources, updating/adding secrets on this module. The Secret resource to update is determined by the secret key name itself. This function only adds or updates values in the Secret resource if the key matches that of the module.
func WithURLs ¶
func WithURLs(s string) BundleOpts
WithURLs applies all the URLs defined in this module to the provided ResMap.
type ExportOpts ¶
func WithExportRootDir ¶
func WithExportRootDir(root string) ExportOpts
type GroupVersionKind ¶
type KustomizeModule ¶
type KustomizeModule struct {
// contains filtered or unexported fields
}
func NewKustomizeModule ¶
func NewKustomizeModule(fs filesys.FileSystem, mod types.Module, prefix string) *KustomizeModule
NewKustomizeModule creates a new Kustomize implemented Module. It expects a filesystem, module type and a prefix. The prefix argument is a string that will prefix this module's name. This is so that the name module can be mapped to a Git repository, without having to reference the module by it's entire URL.
func (*KustomizeModule) BuildEncrypted ¶
func (m *KustomizeModule) BuildEncrypted(data []byte, recipients []string) ([]byte, error)
func (*KustomizeModule) Bundle ¶
func (m *KustomizeModule) Bundle(opts ...BundleOpts) (*Bundle, error)
func (*KustomizeModule) Components ¶
func (m *KustomizeModule) Components() []string
func (*KustomizeModule) Host ¶
func (m *KustomizeModule) Host() string
getHostName returns a string that can be used as value in an ingress host field. This function parses the modules Host struct and builds a hostname value based on the params provided. Prefix & Wildcard fields on the Host struct will be prepended and appended to the string provided to this function.
func (*KustomizeModule) Name ¶
func (m *KustomizeModule) Name() string
Name returns a human readable version of this module. Returns m.Version if there is a value assigned. Otherwise the URL will be used to construct a value
func (*KustomizeModule) Namespace ¶
func (m *KustomizeModule) Namespace() string
func (*KustomizeModule) Ref ¶
func (m *KustomizeModule) Ref() string
func (*KustomizeModule) Resolve ¶
func (m *KustomizeModule) Resolve() error
func (*KustomizeModule) Secrets ¶
func (m *KustomizeModule) Secrets() []Secret
func (*KustomizeModule) URL ¶
func (m *KustomizeModule) URL() string
func (*KustomizeModule) Version ¶
func (m *KustomizeModule) Version() string
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func NewLoader ¶
func NewLoader(fsys filesys.FileSystem) *Loader
type Resource ¶
func (*Resource) Flatten ¶
FlattenSecure flattenes the resource returning a byte array containing a YAML representation of the resource.
func (*Resource) FlattenSecure ¶
FlattenSecure flattenes the resource returning a byte array containing a YAML representation of the resource. If the resource is a v1.Secret, then the output will be encrypted using sops.