netpolerrors

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerbosityFlagsMisUseErrStr = "-q and -v cannot be specified together"
	// k8s errors
	CidrErrTitle           = "CIDR error"
	SelectorErrTitle       = "selector error"
	RulePeerErrTitle       = "rule NetworkPolicyPeer error"
	EmptyRulePeerErrStr    = "cannot have empty rule peer"
	CombinedRulePeerErrStr = "cannot have both IPBlock and PodSelector/NamespaceSelector set"
	NamedPortErrTitle      = "named port error"
	ConvertNamedPortErrStr = "cannot convert named port for an IP destination"

	// parser errors
	NoK8sWorkloadResourcesFoundErrorStr      = "no relevant Kubernetes workload resources found"
	NoK8sNetworkPolicyResourcesFoundErrorStr = "no relevant Kubernetes network policy resources found"
	MalformedYamlDocErrorStr                 = "YAML document is malformed"
	FailedReadingFileErrorStr                = "error reading file"
	NoDocumentIDErrorStr                     = "no document ID is available for this error"
	ConversionToUnstructuredErr              = "failed conversion from resource.Info to unstructured.Unstructured"

	// connlist errors
	EmptyConnListErrStr    = " Connectivity map report will be empty."
	NoIngressSourcesErrStr = "The ingress-controller workload was not added to the analysis, since Ingress/Route resources were not found."
	NoAllowedConnsWarning  = "Connectivity analysis found no allowed connectivity between pairs from the configured workloads or" +
		" external IP-blocks"

	ErrGettingResInfoFromDir     = "Error getting resourceInfos from dir path"
	ConversionToConnectionSetErr = "failed conversion from AllowedSet to ConnectionSet"

	// eval errors
	NoSourceDefinedErr     = "no source defined, source pod and namespace or external IP required"
	NotFoundNamespace      = "could not find peer namespace"
	OnlyOneSrcFlagErrStr   = "only one of source pod and namespace or external IP can be defined, not both"
	NoDestDefinedErr       = "no destination defined, destination pod and namespace or external IP required"
	OnlyOneDstFlagErrStr   = "only one of destination pod and namespace or external IP can be defined, not both"
	OnlyOneIPPeerErrStr    = "only one of source or destination can be defined as external IP, not both"
	RequiredDstPortFlagErr = "destination port name or value is required"

	// diff command errors
	RequiredFlagsErr = "both directory paths dir1 and dir2 are required"
	FlagMisUseErr    = "dirpath flag is not used with diff command"

	// errors constants from `orig errors` that are raised by external libraries
	InvalidCIDRAddr         = "invalid CIDR address"
	InvalidKeyVal           = "key: Invalid value"
	UnrecognizedValType     = "unrecognized type"
	SliceFromMapErr         = "cannot restore slice from map"
	PathNotExistErr         = "does not exist"
	UnknownFileExtensionErr = "recognized file extensions are"
	MissingObjectErr        = "is missing in"
	WrongStartCharacterErr  = "found character that cannot start any token"
	UnmarshalErr            = "cannot unmarshal array into Go value of type unstructured.detector"
	UnableToDecodeErr       = "unable to decode"

	UnknownCommandErr = "unknown command"

	NilRepresentativePodSelectorsErr = "representative pod might not be generated if it does not have any representative selector"
	NilNamespaceAndNilNsSelectorErr  = "representative pod might not be generated from nil namespace-selector and nil namespace;" +
		"at least one should not be nil"
)

Variables

This section is empty.

Functions

func BlockedIngressWarning

func BlockedIngressWarning(objKind, objName, peerStr string) string

BlockedIngressWarning returns warning string of a blocked ingress on peer

func BothSrcAndDstIPsErrStr

func BothSrcAndDstIPsErrStr(srcStr, dstStr string) string

BothSrcAndDstIPsErrStr returns error string that conn from ip to ip is not supported

func ConcatErrors

func ConcatErrors(err1, err2 string) string

ConcatErrors returns the given errors' messages concatenated by colon

func FormatNotSupportedErrStr

func FormatNotSupportedErrStr(format string) string

FormatNotSupportedErrStr returns error string of a not supported format for connlist or diff results

func InvalidPeerErrStr

func InvalidPeerErrStr(peer string) string

InvalidPeerErrStr returns error string of an invalid peer

func MissingNamespaceErrStr

func MissingNamespaceErrStr(nsName, peerName string) string

MissingNamespaceErrStr returns error string of a missing namespace of a peer

func NotFoundPeerErrStr

func NotFoundPeerErrStr(peer string) string

NotFoundPeerErrStr returns error string of a peer could not be found

func NotPeerErrStr

func NotPeerErrStr(peerStr string) string

NotPeerErrStr returns error string of a peer that is not workload peer

func NotRepresentativePeerErrStr added in v1.2.0

func NotRepresentativePeerErrStr(peerStr string) string

func NotSupportedPodResourcesErrorStr

func NotSupportedPodResourcesErrorStr(ownerRefName string) string

NotSupportedPodResourcesErrorStr returns error string of not supported pods with same ownerRef but different labels

func WorkloadDoesNotExistErrStr

func WorkloadDoesNotExistErrStr(workload string) string

WorkloadDoesNotExistErrStr returns error string of missing workload for connlist with focus-workload

Types

This section is empty.

Jump to

Keyboard shortcuts

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