brownfield

package
v0.0.0-...-731cd58 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxAllowedHostNames the maximum number of HostNames allowed for listener.
	MaxAllowedHostNames int = 5
)

Variables

This section is empty.

Functions

func LogHTTPSettings

func LogHTTPSettings(logger Logger, existingBlacklisted []n.ApplicationGatewayBackendHTTPSettings, existingNonBlacklisted []n.ApplicationGatewayBackendHTTPSettings, managedSettings []n.ApplicationGatewayBackendHTTPSettings)

LogHTTPSettings emits a few log lines detailing what settings are created, blacklisted, and removed from ARM.

func LogListeners

func LogListeners(existingBlacklisted []n.ApplicationGatewayHTTPListener, existingNonBlacklisted []n.ApplicationGatewayHTTPListener, managedListeners []n.ApplicationGatewayHTTPListener)

LogListeners emits a few log lines detailing what Listeners are created, blacklisted, and removed from ARM.

func LogPathMaps

func LogPathMaps(existingBlacklisted []n.ApplicationGatewayURLPathMap, existingNonBlacklisted []n.ApplicationGatewayURLPathMap, managedPathMaps []n.ApplicationGatewayURLPathMap)

LogPathMaps emits a few log lines detailing what pathMaps are created, blacklisted, and removed from ARM.

func LogPools

func LogPools(existingBlacklisted []n.ApplicationGatewayBackendAddressPool, existingNonBlacklisted []n.ApplicationGatewayBackendAddressPool, managedPools []n.ApplicationGatewayBackendAddressPool)

LogPools emits a few log lines detailing what pools are created, blacklisted, and removed from ARM.

func LogProbes

func LogProbes(logger Logger, existingBlacklisted []n.ApplicationGatewayProbe, existingNonBlacklisted []n.ApplicationGatewayProbe, managedProbes []n.ApplicationGatewayProbe)

LogProbes emits a few log lines detailing what probes are created, blacklisted, and removed from ARM.

func LogRedirects

func LogRedirects(existingBlacklisted []n.ApplicationGatewayRedirectConfiguration, existingNonBlacklisted []n.ApplicationGatewayRedirectConfiguration, managedRedirects []n.ApplicationGatewayRedirectConfiguration)

LogRedirects emits a few log lines detailing what Redirects are created, blacklisted, and removed from ARM.

func LogRules

func LogRules(existingBlacklisted []n.ApplicationGatewayRequestRoutingRule, existingNonBlacklisted []n.ApplicationGatewayRequestRoutingRule, managedRules []n.ApplicationGatewayRequestRoutingRule)

LogRules emits a few log lines detailing what rules are created, blacklisted, and removed from ARM.

func MergeCerts

MergeCerts merges list of lists of certs into a single list, maintaining uniqueness.

func MergeHTTPSettings

func MergeHTTPSettings(settingBuckets ...[]n.ApplicationGatewayBackendHTTPSettings) []n.ApplicationGatewayBackendHTTPSettings

MergeHTTPSettings merges list of lists of HTTP Settings into a single list, maintaining uniqueness.

func MergeListeners

func MergeListeners(listenerBuckets ...[]n.ApplicationGatewayHTTPListener) []n.ApplicationGatewayHTTPListener

MergeListeners merges list of lists of listeners into a single list, maintaining uniqueness.

func MergePathMaps

func MergePathMaps(pathMapBuckets ...[]n.ApplicationGatewayURLPathMap) []n.ApplicationGatewayURLPathMap

MergePathMaps merges list of lists of pathMaps into a single list, maintaining uniqueness.

func MergePools

MergePools merges list of lists of backend address pools into a single list, maintaining uniqueness.

func MergeProbes

func MergeProbes(probesBuckets ...[]n.ApplicationGatewayProbe) []n.ApplicationGatewayProbe

MergeProbes merges list of lists of health probes into a single list, maintaining uniqueness.

func MergeRedirects

MergeRedirects merges list of lists of redirects into a single list, maintaining uniqueness.

func MergeRules

MergeRules merges list of lists of rules into a single list, maintaining uniqueness.

func PruneIngressRules

func PruneIngressRules(ing *networking.Ingress, prohibitedTargets []*ptv1.AzureIngressProhibitedTarget) []networking.IngressRule

PruneIngressRules transforms the given ingress struct to remove targets, which AGIC should not create configuration for.

Types

type ExistingResources

type ExistingResources struct {
	BackendPools       []n.ApplicationGatewayBackendAddressPool
	Certificates       []n.ApplicationGatewaySslCertificate
	RoutingRules       []n.ApplicationGatewayRequestRoutingRule
	Listeners          []n.ApplicationGatewayHTTPListener
	URLPathMaps        []n.ApplicationGatewayURLPathMap
	HTTPSettings       []n.ApplicationGatewayBackendHTTPSettings
	Ports              []n.ApplicationGatewayFrontendPort
	Probes             []n.ApplicationGatewayProbe
	Redirects          []n.ApplicationGatewayRedirectConfiguration
	ProhibitedTargets  []*ptv1.AzureIngressProhibitedTarget
	DefaultBackendPool *n.ApplicationGatewayBackendAddressPool
	// contains filtered or unexported fields
}

ExistingResources is used in brownfield deployments and holds a copy of the existing App Gateway config, based on which AGIC will determine what should be retained and what config should be discarded or overwritten.

func NewExistingResources

func NewExistingResources(appGw n.ApplicationGateway, prohibitedTargets []*ptv1.AzureIngressProhibitedTarget, defaultPool *n.ApplicationGatewayBackendAddressPool) ExistingResources

NewExistingResources creates a new ExistingResources struct.

func (ExistingResources) GetBlacklistedHTTPSettings

GetBlacklistedHTTPSettings filters the given list of routing pathMaps to the list pathMaps that AGIC is allowed to manage. HTTP Setting is blacklisted when it is associated with a Routing Rule that is blacklisted.

func (ExistingResources) GetBlacklistedListeners

GetBlacklistedListeners filters the given list of health probes to the list Probes that AGIC is allowed to manage.

func (ExistingResources) GetBlacklistedPathMaps

GetBlacklistedPathMaps filters the given list of routing pathMaps to the list pathMaps that AGIC is allowed to manage.

func (ExistingResources) GetBlacklistedPools

GetBlacklistedPools removes the managed pools from the given list of pools; resulting in a list of pools not managed by AGIC.

func (ExistingResources) GetBlacklistedProbes

func (er ExistingResources) GetBlacklistedProbes() ([]n.ApplicationGatewayProbe, []n.ApplicationGatewayProbe)

GetBlacklistedProbes filters the given list of health probes to the list Probes that AGIC is allowed to manage.

func (ExistingResources) GetBlacklistedRedirects

GetBlacklistedRedirects removes the managed redirects from the given list of redirects; resulting in a list of redirects not managed by AGIC.

func (ExistingResources) GetBlacklistedRoutingRules

GetBlacklistedRoutingRules filters the given list of routing rules to the list rules that AGIC is allowed to manage.

type Logger

type Logger interface {
	// Info is the a function allowing us to log messages.
	Info(args ...interface{})
}

Logger is an abstraction over a logging facility.

type Target

type Target struct {
	Hostname string     `json:"Hostname,omitempty"`
	Path     TargetPath `json:"Path,omitempty"`
}

Target uniquely identifies a subset of App Gateway configuration, which AGIC will manage or be prohibited from managing.

func (Target) IsBlacklisted

func (t Target) IsBlacklisted(blacklist TargetBlacklist) bool

IsBlacklisted figures out whether a given Target objects in a list of blacklisted targets.

type TargetBlacklist

type TargetBlacklist *[]Target

TargetBlacklist is a list of Targets, which AGIC is not allowed to apply configuration for.

func GetTargetBlacklist

func GetTargetBlacklist(prohibitedTargets []*ptv1.AzureIngressProhibitedTarget) TargetBlacklist

GetTargetBlacklist returns the list of Targets given a list ProhibitedTarget CRDs.

type TargetPath

type TargetPath string

TargetPath is a string type alias.

Jump to

Keyboard shortcuts

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