recon

package
v0.0.0-...-441e984 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package recon reconciles sceptre directories.

Index

Examples

Constants

This section is empty.

Variables

Fs is the filesystem. Setting this allows an in-memory filesystem for testing.

Functions

func All

func All(d string)

All checks.

Example
package main

import (
	"github.com/spf13/afero"
	"gitlab.com/theherk/sceptre-recon/pkg/recon"
)

func main() {
	fs := afero.NewMemMapFs()
	fs.MkdirAll("sceptre/templates", 0755)
	fs.MkdirAll("sceptre/config", 0755)
	recon.Fs = fs
	recon.All("sceptre")
}
Output:

sceptre: sceptre root found; checking
Example (MissingTemplate)
package main

import (
	"github.com/spf13/afero"
	"gitlab.com/theherk/sceptre-recon/pkg/recon"
)

func main() {
	fs := afero.NewMemMapFs()
	fs.MkdirAll("sceptre/templates", 0755)
	fs.MkdirAll("sceptre/config", 0755)
	afero.WriteFile(fs, "sceptre/config/cfgA.yaml", []byte("template_path: tmplA.yaml"), 0644)
	recon.Fs = fs
	recon.All("sceptre")
}
Output:

sceptre: sceptre root found; checking
sceptre/config/cfgA.yaml: template missing; tmplA.yaml
Example (UnusedTemplate)
package main

import (
	"github.com/spf13/afero"
	"gitlab.com/theherk/sceptre-recon/pkg/recon"
)

func main() {
	fs := afero.NewMemMapFs()
	fs.MkdirAll("sceptre/templates", 0755)
	fs.MkdirAll("sceptre/config", 0755)
	afero.WriteFile(fs, "sceptre/templates/tmplA.yaml", []byte(""), 0644)
	recon.Fs = fs
	recon.All("sceptre")
}
Output:

sceptre: sceptre root found; checking
sceptre/templates/tmplA.yaml: template exists, but is not used

Types

This section is empty.

Jump to

Keyboard shortcuts

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