templates

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package templates provides a way to load and store an application's helm chart templates.

Currently, an app's templates are stored as a ConfigMap including templates provided by ketch by default.

apiVersion: v1 kind: ConfigMap metadata:

name: <name>
namespace: ketch-system

data:

services.yaml: |-
  ..
deployments.yaml: |-
  ..

Index

Constants

This section is empty.

Variables

View Source
var (
	IstioDefaultTemplates = Templates{
		Yamls: GeneratedYamls.IstioYamls,
	}
	TraefikDefaultTemplates = Templates{
		Yamls: GeneratedYamls.TraefikYamls,
	}
	NginxDefaultTemplates = Templates{
		Yamls: GeneratedYamls.NginxYamls,
	}
	JobTemplates = Templates{
		Yamls: GeneratedYamls.JobYamls,
	}
)

Functions

func IngressConfigMapName

func IngressConfigMapName(ingress string) string

IngressConfigMapName returns a name of a configmap to store the ingress' templates to render helm chart.

func JobConfigMapName

func JobConfigMapName() string

JobConfigMapName returns a name of a configmap to store the job's templates to render the helm chart

Types

type Client

type Client interface {
	Reader
	Updater
}

Client knows how to read and update templates stored in a kubernetes cluster.

type Reader

type Reader interface {
	Get(name string) (*Templates, error)
}

Reader knows how to get templates.

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage is an implementation of Client interface.

func NewStorage

func NewStorage(client client.Client, namespace string) *Storage

NewStorage returns a Storage instance.

func (*Storage) Get

func (s *Storage) Get(name string) (*Templates, error)

Get returns templates stored in a configmap with the provided name.

func (*Storage) Update

func (s *Storage) Update(name string, templates Templates) error

Update creates or updates a configmap with the new templates.

type Templates

type Templates struct {

	// Yamls contains a content for each yaml file in a helm chart's "templates/" folder.
	Yamls map[string]string
}

Templates represents a helm chart's "templates/" folder.

type Updater

type Updater interface {
	Update(name string, templates Templates) error
}

Updater knows how to update and delete templates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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