Documentation ¶
Index ¶
- func BackupIfPresent(fs afero.Afero, basePath string, logger log.Logger, ui cli.Ui) error
- func BailIfPresent(fs afero.Afero, basePath string, logger log.Logger) error
- func ExcludeKubernetesPatch(fs afero.Afero, basePath string, excludedResource resid.ResId) error
- func ExcludeKubernetesResource(fs afero.Afero, basePath string, excludedResource string) ([]resid.ResId, error)
- func ExcludeKubernetesResources(fs afero.Afero, basePath string, overlaysPath string, ...) error
- func FindOnlySubdir(dir string, fs afero.Afero) (string, error)
- func GenerateNameFromMetadata(k8sYaml MinimalK8sYaml, idx int) string
- func IsGithubURL(url string) bool
- func IsK8sYaml(fs *afero.Afero, target string) bool
- func IsLegalPath(path string) error
- func MarshalIndent(indent int, in interface{}) ([]byte, error)
- func MaybeSplitMultidocYaml(ctx context.Context, fs afero.Afero, localPath string) error
- func NewKubernetesResource(in []byte) (*resource.Resource, error)
- func NewKubernetesResources(in []byte) ([]*resource.Resource, error)
- func RecursiveCopy(fs afero.Afero, sourceDir, destDir string) error
- func RecursiveNormalizeCopyKustomize(fs afero.Afero, sourceDir, destDir string) error
- func ResIDs(in []*resource.Resource) (generated []resid.ResId)
- func ShouldAddFileToBase(fs *afero.Afero, excludedBases []string, targetPath string) bool
- func SplitAllKustomize(fs afero.Afero, path string) error
- func ToGroupVersionKind(in gvk.Gvk) schema.GroupVersionKind
- func UnExcludeKubernetesResource(fs afero.Afero, basePath string, unExcludedResource string) error
- func WritePostKustomizeFiles(debug log.Logger, FS afero.Afero, dest string, ...) error
- type AssetUploader
- type CAType
- type CertType
- type GithubURL
- type ListK8sYaml
- type MinimalK8sMetadata
- type MinimalK8sYaml
- type PostKustomizeFile
- type PostKustomizeFileCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupIfPresent ¶
func BailIfPresent ¶
BailIfPresent returns an error if the path is present. Handy to prevent accidentally blowing away directories on the workstation.
func ExcludeKubernetesPatch ¶ added in v0.48.1
for the provided base and all subbases, check each strategic merge patch and json patch if they match the resid provided, remove them
func ExcludeKubernetesResource ¶ added in v0.47.0
func ExcludeKubernetesResource(fs afero.Afero, basePath string, excludedResource string) ([]resid.ResId, error)
exclude the provided kubernetes resource file from the kustomization.yaml at basePath, or from bases imported from that.
func ExcludeKubernetesResources ¶ added in v0.47.0
func ExcludeKubernetesResources(fs afero.Afero, basePath string, overlaysPath string, excludedResources []string) error
calls ExcludeKubernetesResource for each excluded resource. Returns after the first error.
func FindOnlySubdir ¶
FindOnlySubdir finds the only subdirectory of a directory.
func GenerateNameFromMetadata ¶ added in v0.25.0
func GenerateNameFromMetadata(k8sYaml MinimalK8sYaml, idx int) string
func IsGithubURL ¶
returns true if this parses as a valid Github URL.
func IsLegalPath ¶ added in v0.34.0
IsLegalPath checks if the provided path is a relative path within the current working directory or within the os tempdir. If it is not, it returns an error.
func MarshalIndent ¶ added in v0.49.0
func MaybeSplitMultidocYaml ¶ added in v0.28.0
this function is not perfect, and has known limitations. One of these is that it does not account for `\n---\n` in multiline strings.
func NewKubernetesResource ¶ added in v0.28.0
func NewKubernetesResources ¶ added in v0.48.1
func RecursiveCopy ¶ added in v0.47.0
func RecursiveNormalizeCopyKustomize ¶ added in v0.47.0
RecursiveNormalizeCopyKustomize copies kubernetes yaml from the source directory into the dest directory. `kustomization.yaml` files are skipped. if `kustomization.yaml` contains any bases, those bases are recursively copied into `destDir/<base-name>/`
func ShouldAddFileToBase ¶ added in v0.34.0
func SplitAllKustomize ¶ added in v0.47.0
SplitAllKustomize ensures that all yaml files within the designated directory are split into one resource per file, excepting CRDs if a kustomization yaml existed beforehand, it rewrites the resource list to match the new filenames if not, it creates a kustomization yaml if an existing kustomization yaml referred to other bases, splitAll will be called on those bases as well
func ToGroupVersionKind ¶ added in v0.32.0
func ToGroupVersionKind(in gvk.Gvk) schema.GroupVersionKind
func UnExcludeKubernetesResource ¶ added in v0.48.0
UnExcludeKubernetesResource finds a deleted resource in a child of the basePath and includes it again
func WritePostKustomizeFiles ¶ added in v0.33.0
Types ¶
type AssetUploader ¶ added in v0.16.0
func NewAssetUploader ¶ added in v0.16.0
func NewAssetUploader( logger log.Logger, client *http.Client, ) AssetUploader
type ListK8sYaml ¶ added in v0.33.0
type MinimalK8sMetadata ¶ added in v0.26.0
type MinimalK8sYaml ¶ added in v0.26.0
type MinimalK8sYaml struct { Kind string `json:"kind" yaml:"kind" hcl:"kind"` Metadata MinimalK8sMetadata `json:"metadata" yaml:"metadata" hcl:"metadata"` }
type PostKustomizeFile ¶ added in v0.33.0
type PostKustomizeFile struct { Order int Minimal MinimalK8sYaml Full interface{} }
type PostKustomizeFileCollection ¶ added in v0.33.0
type PostKustomizeFileCollection []PostKustomizeFile
func (PostKustomizeFileCollection) Len ¶ added in v0.33.0
func (c PostKustomizeFileCollection) Len() int
func (PostKustomizeFileCollection) Less ¶ added in v0.33.0
func (c PostKustomizeFileCollection) Less(i, j int) bool
func (PostKustomizeFileCollection) Swap ¶ added in v0.33.0
func (c PostKustomizeFileCollection) Swap(i, j int)