Documentation ¶
Overview ¶
Package utils implements common, reusable helpers
Index ¶
- func Dig(fqdn string, edgeDNSServers ...DNSServer) (ips []string, err error)
- func EqualAnnotations(a, b map[string]string) bool
- func EqualPredefinedAnnotations(a1, a2 map[string]string, controlledAnnotations ...string) bool
- func Exchange(m *dns.Msg, edgeDNSServers []DNSServer) (msg *dns.Msg, err error)
- func FileToGSLB(file string) *k8gbv1beta1.Gslb
- func FileToIngress(file string) *netv1.Ingress
- func FileToIstioGateway(file string) *istio.Gateway
- func FileToIstioVirtualService(file string) *istio.VirtualService
- func FileToService(file string) *corev1.Service
- func GetType(v interface{}) string
- func MergeAnnotations(target map[string]string, source map[string]string, ...) map[string]string
- func SplitAfter(s string, re *regexp.Regexp) (r []string)
- func YamlToGslb(yaml []byte) (*k8gbv1beta1.Gslb, error)
- func YamlToIngress(yaml []byte) (*netv1.Ingress, error)
- func YamlToIstioGateway(yaml []byte) (*istio.Gateway, error)
- func YamlToIstioVirtualService(yaml []byte) (*istio.VirtualService, error)
- func YamlToService(yaml []byte) (*corev1.Service, error)
- type DNSList
- type DNSMock
- func (m *DNSMock) AddAAAARecord(ip net.IP) *DNSMock
- func (m *DNSMock) AddARecord(fqdn string, ip net.IP) *DNSMock
- func (m *DNSMock) AddNSRecord(fqdn, nsName string) *DNSMock
- func (m *DNSMock) AddTXTRecord(fqdn string, strings ...string) *DNSMock
- func (m *DNSMock) RunTestFunc(f func()) *Result
- func (m *DNSMock) Start() *DNSMock
- type DNSServer
- type FakeDNSSettings
- type ReconcileResultHandler
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dig ¶
Dig returns a list of IP addresses for a given FQDN by using the dns servers from edgeDNSServers dns servers are tried one by one from the edgeDNSServers and if there is a non-error response it is returned and the rest is not tried
func EqualAnnotations ¶ added in v0.14.0
func EqualPredefinedAnnotations ¶ added in v0.14.0
EqualPredefinedAnnotations checks if there has been a change in controlledAnnotations, it ignores the rest
func FileToGSLB ¶ added in v0.14.0
func FileToGSLB(file string) *k8gbv1beta1.Gslb
FileToGSLB takes a file and returns a GSLB object
func FileToIngress ¶ added in v0.14.0
FileToIngress takes a file and returns an Ingress object
func FileToIstioGateway ¶ added in v0.14.0
FileToIstioGateway takes a file and returns a Gateway object
func FileToIstioVirtualService ¶ added in v0.14.0
func FileToIstioVirtualService(file string) *istio.VirtualService
FileToIstioVirtualService takes a file and returns a VirtualService object
func FileToService ¶ added in v0.14.0
FileToService takes a file and returns a Service object
func MergeAnnotations ¶
func MergeAnnotations(target map[string]string, source map[string]string, controlledAnnotations ...string) map[string]string
MergeAnnotations adds or updates annotations from source to target and returns merge
func SplitAfter ¶
SplitAfter works as the same way as strings.SplitAfter() but the separator is regexp
func YamlToGslb ¶
func YamlToGslb(yaml []byte) (*k8gbv1beta1.Gslb, error)
YamlToGslb takes yaml and returns a Gslb object
func YamlToIngress ¶
YamlToIngress takes yaml and returns Gslb object
func YamlToIstioGateway ¶ added in v0.14.0
YamlToIstioGateway takes yaml and returns an Istio Gateway object
func YamlToIstioVirtualService ¶ added in v0.14.0
func YamlToIstioVirtualService(yaml []byte) (*istio.VirtualService, error)
YamlToIstioVirtualService takes yaml and returns an Istio Virtual Service object
Types ¶
type DNSMock ¶
type DNSMock struct {
// contains filtered or unexported fields
}
DNSMock acts as DNS server but returns mock values
func NewFakeDNS ¶
func NewFakeDNS(settings FakeDNSSettings) *DNSMock
func (*DNSMock) AddNSRecord ¶
func (*DNSMock) AddTXTRecord ¶
func (*DNSMock) RunTestFunc ¶
type FakeDNSSettings ¶
type ReconcileResultHandler ¶
type ReconcileResultHandler struct {
// contains filtered or unexported fields
}
func NewReconcileResultHandler ¶
func NewReconcileResultHandler(reconcileAfter int) *ReconcileResultHandler
func (*ReconcileResultHandler) Requeue ¶
func (r *ReconcileResultHandler) Requeue() (ctrl.Result, error)
Requeue requeue loop after config.ReconcileRequeueSeconds this apply in case you didn't modify request resources. If so, reconciliation starts immediately see: https://github.com/operator-framework/operator-sdk/issues/1164
func (*ReconcileResultHandler) RequeueError ¶
func (r *ReconcileResultHandler) RequeueError(err error) (ctrl.Result, error)
RequeueError requeue loop immediately see default controller limiter: https://danielmangum.com/posts/controller-runtime-client-go-rate-limiting/
func (*ReconcileResultHandler) RequeueNow ¶
func (r *ReconcileResultHandler) RequeueNow() (ctrl.Result, error)