core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string, doc []byte) ([]byte, error)

Delete takes a JSON path and JSON document and returns a JSON document with the input path deleted.

func Merge

func Merge(_ context.Context, c *Config, logger logr.Logger) (string, error)

Merge combines the "controller" and "gateway" sections of an "ingress" chart values.yaml into a single root-level collection of settings for use with the 3.x "kong" chart. It must be run after an initial pass of the main command to migrate moved keys to their new locations.

func MergeOut

func MergeOut(ctx context.Context, c *Config, logger logr.Logger) error

func Move

func Move(start, end string, doc []byte) ([]byte, bool, error)

Move takes a start and end JSON path string and a document, and returns a document with the start path moved to the end path. It also returns a boolean indicating if the start path is not present, in which case the input document is returned unmodified.

func Run

func Run(_ context.Context, c *Config, logger logr.Logger) (string, error)

Run takes a configuration string and returns a migrated configuration string.

func RunOut

func RunOut(ctx context.Context, c *Config, logger logr.Logger) error

RunOut runs Run and prints its result to stdout.

Types

type Config

type Config struct {
	// SourceChart indicates whether the values.yaml to migrate comes from the "kong" or "ingress" chart
	SourceChart string

	// InputFile is the values.yaml filename to migrate.
	InputFile string

	// OutputFormat is the output format.
	OutputFormat string
	// contains filtered or unexported fields
}

func (*Config) FlagSet

func (c *Config) FlagSet() *pflag.FlagSet

type IngressValues

type IngressValues struct {
	Gateway    map[string]interface{} `json:"gateway,omitempty" yaml:"gateway,omitempty"`
	Controller map[string]interface{} `json:"controller,omitempty" yaml:"controller,omitempty"`
	// IngressController should not exist in normal ingress values, only those that have first passed through the
	// migrate command.
	IngressController map[string]interface{} `json:"ingressController,omitempty" yaml:"ingressController,omitempty"`
}

Jump to

Keyboard shortcuts

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