Documentation ¶
Index ¶
- func ConvertObject(schema resource.Schema, object IstioObject, domain string) (*config.Config, error)
- func ConvertObjectInternal(schema resource.Schema, object IstioObject, domain string, ...) (*config.Config, error)
- func FromJSON(s resource.Schema, js string) (config.Spec, error)
- func FromJSONMap(s resource.Schema, data any) (config.Spec, error)
- func FromJSONStrict(s resource.Schema, js string) (config.Spec, error)
- func FromYAML(s resource.Schema, yml string) (config.Spec, error)
- func StatusJSONFromMap(schema resource.Schema, jsonMap *json.RawMessage) (config.Status, error)
- type ConversionFunc
- type IstioKind
- type IstioObject
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 ConvertObjectInternal ¶
func ConvertObjectInternal(schema resource.Schema, object IstioObject, domain string, convert ConversionFunc) (*config.Config, error)
func FromJSONMap ¶
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 StatusJSONFromMap ¶
Types ¶
type IstioKind ¶
type IstioKind struct { metav1.TypeMeta metav1.ObjectMeta `json:"metadata"` Spec json.RawMessage `json:"spec"` Status *json.RawMessage `json:"status,omitempty"` }
IstioKind is the generic Kubernetes API object wrapper
func ParseInputs ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioKind.
func (*IstioKind) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IstioKind) DeepCopyObject ¶
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) GetStatus ¶
func (in *IstioKind) GetStatus() *json.RawMessage
GetStatus from a wrapper
type IstioObject ¶
type IstioObject interface { runtime.Object GetSpec() json.RawMessage GetStatus() *json.RawMessage 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