crd

package
v0.0.0-...-a8cf79f Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 76

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertObject

func ConvertObject(schema resource.Schema, object IstioObject, domain string) (*config.Config, error)

ConvertObject converts an IstioObject k8s-style object to the internal configuration model.

func FromJSON

func FromJSON(s resource.Schema, js string) (config.Spec, error)

FromJSON converts a canonical JSON to a proto message

func FromJSONMap

func FromJSONMap(s resource.Schema, data any) (config.Spec, error)

FromJSONMap converts from a generic map to a proto message using canonical JSON encoding JSON encoding is specified here: https://developers.google.com/protocol-buffers/docs/proto3#json

func FromYAML

func FromYAML(s resource.Schema, yml string) (config.Spec, error)

FromYAML converts a canonical YAML to a proto message

func StatusJSONFromMap

func StatusJSONFromMap(schema resource.Schema, jsonMap map[string]any) (config.Status, error)

Types

type IstioKind

type IstioKind struct {
	metav1.TypeMeta
	metav1.ObjectMeta `json:"metadata"`
	Spec              map[string]any `json:"spec"`
	Status            map[string]any `json:"status,omitempty"`
}

IstioKind is the generic Kubernetes API object wrapper

func ParseInputs

func ParseInputs(inputs string) ([]config.Config, []IstioKind, error)

ParseInputs reads multiple documents from `kubectl` output and checks with the schema. It also returns the list of unrecognized kinds as the second response.

NOTE: This function only decodes a subset of the complete k8s ObjectMeta as identified by the fields in model.Meta. This would typically only be a problem if a user dumps an configuration object with kubectl and then re-ingests it.

func (*IstioKind) DeepCopy

func (in *IstioKind) DeepCopy() *IstioKind

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioKind.

func (*IstioKind) DeepCopyInto

func (in *IstioKind) DeepCopyInto(out *IstioKind)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IstioKind) DeepCopyObject

func (in *IstioKind) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*IstioKind) GetObjectMeta

func (in *IstioKind) GetObjectMeta() metav1.ObjectMeta

GetObjectMeta from a wrapper

func (*IstioKind) GetSpec

func (in *IstioKind) GetSpec() map[string]any

GetSpec from a wrapper

func (*IstioKind) GetStatus

func (in *IstioKind) GetStatus() map[string]any

GetStatus from a wrapper

type IstioObject

type IstioObject interface {
	runtime.Object
	GetSpec() map[string]any
	GetStatus() map[string]any
	GetObjectMeta() metav1.ObjectMeta
}

IstioObject is a k8s wrapper interface for config objects

func ConvertConfig

func ConvertConfig(cfg config.Config) (IstioObject, error)

ConvertConfig translates Istio config to k8s config JSON

Jump to

Keyboard shortcuts

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