secretparameter

package
v0.0.0-...-e0434a4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Secret Parameter Plugin for Smith

This takes ServiceBindings or explicit Secret dependencies, and converts them into a form acceptable to parametersFrom in Service Catalog.

e.g. a ServiceBinding with a smith resource name of my-binding produces a secret like so:

Secret:
  myVar: x

And with a plugin spec of:

plugin:
  spec:
    mapping:
      my-binding: # <-- name of Smith resource
        myVar: myComputeInputVar

we end up with:

Secret: my-binding: > {"myComputeInputVar": "x"}

This plugin will error out if the mapping is not possible in any way (i.e. there is no my-binding amongst the dependencies, OR there is no myVar in the secret generated by my-binding).

For a slightly more real example, see the examples directory.

Running

This is run by adding it as a Smith plugin. See cmd/smith/main.go, or run:

make run-smith-sc-minikube

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (smith_plugin.Plugin, error)

Types

type Plugin

type Plugin struct{}

func (*Plugin) Describe

func (p *Plugin) Describe() *smith_plugin.Description

func (*Plugin) Process

func (p *Plugin) Process(rawSpec map[string]interface{}, context *smith_plugin.Context) smith_plugin.ProcessResult

type Spec

type Spec struct {
	// double map should be read as:
	//   map the secret contents of a particular smith resource into the SC parameter format
	//   according to the map[string]string, where LHS original naming -> RHS parameter naming
	//   If a secret key is not in the map, it is ignored.
	// See README.md for an example.
	Mapping map[smith_v1.ResourceName]map[string]string `json:"mapping"`
}

Jump to

Keyboard shortcuts

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