From 241c4d337f0362fd0cfacbd43961b10bc85f495e Mon Sep 17 00:00:00 2001 From: Alejandro Pedraza Date: Tue, 30 Jul 2019 14:11:21 -0500 Subject: [PATCH] Common structs for Helm This PR adds `pkg/inject/template-values.go` which contains the structs needed to set the helm variables during injection. They can also be leveraged during installation: ``` package inject type ( // Image contains the details to define a container image Image struct { Name string PullPolicy string Version string } // Port contains all the port-related setups Port struct { Admin int32 Control int32 Inbound int32 Outbound int32 IgnoreInboundPorts string IgnoreOutboundPorts string } // Constraints wraps the Limit and Request settings for computational resources Constraints struct { Limit string Request string } // Resources represents the computational resources setup for a given container Resources struct { CPU Constraints Memory Constraints } // Identity contains the fields to set the identity variables in the proxy // sidecar container Identity struct { TrustDomain string TrustAnchors string } // Proxy contains the fields to set the proxy sidecar container Proxy struct { Component string ClusterDomain string DisableIdentity bool EnableExternalProfile bool HighAvailability bool Identity *Identity Image Image LogLevel string ControlPlaneNamespace string Port Port UID int64 ResourceRequirements *Resources } // ProxyInit contains the fields to set the proxy-init container ProxyInit struct { Image Image Port Port UID int64 ResourceRequirements *Resources } ) ``` Signed-off-by: Alejandro Pedraza --- pkg/inject/template-values.go | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 pkg/inject/template-values.go diff --git a/pkg/inject/template-values.go b/pkg/inject/template-values.go new file mode 100644 index 0000000000000..45ca50dbcd186 --- /dev/null +++ b/pkg/inject/template-values.go @@ -0,0 +1,63 @@ +package inject + +type ( + // Image contains the details to define a container image + Image struct { + Name string + PullPolicy string + Version string + } + + // Port contains all the port-related setups + Port struct { + Admin int32 + Control int32 + Inbound int32 + Outbound int32 + IgnoreInboundPorts string + IgnoreOutboundPorts string + } + + // Constraints wraps the Limit and Request settings for computational resources + Constraints struct { + Limit string + Request string + } + + // Resources represents the computational resources setup for a given container + Resources struct { + CPU Constraints + Memory Constraints + } + + // Identity contains the fields to set the identity variables in the proxy + // sidecar container + Identity struct { + TrustDomain string + TrustAnchors string + } + + // Proxy contains the fields to set the proxy sidecar container + Proxy struct { + Component string + ClusterDomain string + DisableIdentity bool + EnableExternalProfile bool + HighAvailability bool + Identity *Identity + Image Image + LogLevel string + ControlPlaneNamespace string + Port Port + UID int64 + ResourceRequirements *Resources + } + + // ProxyInit contains the fields to set the proxy-init container + ProxyInit struct { + Image Image + Port Port + UID int64 + ResourceRequirements *Resources + } +)