Documentation ¶
Index ¶
- func ImportOutput(release, namespace, repository string) (string, error)
- type Client
- func (c *Client) Continue() bool
- func (c *Client) CreateNamespace(namespace string, annotations, labels map[string]string, ...) error
- func (c *Client) CreateOrPatchNamespace(overWrite bool, namespaceName string, namespaceMgmt course.NamespaceConfig, ...) error
- func (c *Client) Diff() error
- func (c *Client) GetManifests() (string, error)
- func (c *Client) Init(fileName string, initKubeClient bool) error
- func (c *Client) NamespaceManagement() error
- func (c *Client) PatchNamespace(namespace string, annotations, labels map[string]string) error
- func (c *Client) Plot() error
- func (c Client) TemplateAll() (fullOutput string, err error)
- func (c Client) TemplateRelease(releaseName string) (string, error)
- func (c *Client) Update() error
- func (c Client) UpdateHelmRepos() error
- func (c *Client) WriteArgoApplications(outputDir string) (err error)
- func (c *Client) WriteSplitYaml(in []byte, basePath string, releaseName string) (err error)
- type ImportInfo
- type ImportValues
- type Manifest
- type ManifestDiff
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportOutput ¶
Types ¶
type Client ¶
type Client struct { // KubClient is kubernetes client interface. Will be populated in the cilent.Init() function KubeClient kubernetes.Interface // Helm is a reckoner helm client. Will be populated in the client.Init() function Helm helm.Client // The version of Reckoner that is being used ReckonerVersion string // CourseFile will be populated in the client.Init() function CourseFile course.FileV2 // PlotAll should be set to true if operating on all releases in the course PlotAll bool // Releases is a list of releases to operate on if PlotAll is false Releases []string // BaseDirectory is the directory where the course file is located BaseDirectory string // DryRun is a flag to indicate if the client should be run in dry run mode DryRun bool // CreateNamespaces is a flag to indicate if the client should create namespaces CreateNamespaces bool // ContinueOnError is a flag to indicate if the client should continue if one release fails ContinueOnError bool // Errors is a counter of errors encountered during the use of this cilent Errors int // HelmArgs is a list of helm args to pass to helm when running commands HelmArgs []string // Schema is a byte slice representation of the coursev2 json schema Schema []byte // OutputDirectory is the directory which will contain each YAML manifest in a separate file OutputDirectory string }
Client is a configuration struct
func (*Client) CreateNamespace ¶
func (c *Client) CreateNamespace(namespace string, annotations, labels map[string]string, runningNamespaceList *v1.NamespaceList) error
CreateNamespace creates a kubernetes namespace with the given annotations and labels
func (*Client) CreateOrPatchNamespace ¶
func (c *Client) CreateOrPatchNamespace(overWrite bool, namespaceName string, namespaceMgmt course.NamespaceConfig, namespaces *v1.NamespaceList) error
CreateOrPatchNamespace creates or patches namespace based on the configurations
func (*Client) Diff ¶
Diff gathers a given release's manifest and templates and outputs a string of diffs if there are any or reports that there are no diffs.
func (*Client) GetManifests ¶
func (*Client) Init ¶
Init initializes a client. Attempts to open a v2 schema course file If getClient is true, attempts to get a Kubernetes client from config
func (*Client) NamespaceManagement ¶
NamespaceManagement manages namespace names, annotations and labels
func (*Client) PatchNamespace ¶
PatchNamespace patches a kubernetes namespace with the given annotations and labels
func (Client) TemplateAll ¶
TemplateAll runs the same as plot but runs template instead
func (Client) TemplateRelease ¶
TemplateRelease does the same thing as TemplateAll but only for one release
func (Client) UpdateHelmRepos ¶
UpdateHelmRepos updates Helm repos TODO actually return an error if any are encountered
func (*Client) WriteArgoApplications ¶
type ImportInfo ¶
type ImportValues ¶
type ImportValues map[string]interface{}
type Manifest ¶
Manifest represents a single kubernetes yaml manifest from a helm release. It could be from a 'template' command or 'get' command.
func ManifestUnmarshal ¶
ManifestUnmarshal converts a manifest string that includes all resources from a chart and breaks them up into their individual resource manifests.
Returns a slice of Manifest structs.
func (*Manifest) UnmarshalYAML ¶
UnmarshalYAML satisfies the yaml.Unmarshaler interface for a Manifest object. This ensures that a manifest object can properly pull the Source, Kind, and Metadata fields and then populates the contents field with the raw yaml, not including the Source comment.
type ManifestDiff ¶
type ManifestDiff struct { ReleaseName string Kind string Name string Source string Diff string NewFile bool }
ManifestDiff is a struct that contains the diff between a manifest (from 'helm get manifest') and a template (from 'helm template') The fields help identify the which resource is being diffed from the helm chart.
func (ManifestDiff) String ¶
func (md ManifestDiff) String() string
String returns a string representation of the ManifestDiff