Skip to content

Commit

Permalink
add docs comment to new annotation provider
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Sep 24, 2024
1 parent 0b83ae8 commit 2dfd3c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/apis/ingress/ingressannotationprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

type AnnotationProvider interface {
// GetAnnotations returns annotations for use on Ingress resources
GetAnnotations(component radixv1.RadixCommonDeployComponent, namespace string) (map[string]string, error)
}

Expand Down Expand Up @@ -137,6 +138,8 @@ func NewIngressPublicAllowListAnnotationProvider() AnnotationProvider {

type ingressPublicAllowListAnnotationProvider struct{}

// GetAnnotations returns annotations for only allowing public ingress traffic
// for IPs or CIDRs defined in Network.Ingress.Public.Allow for a component
func (*ingressPublicAllowListAnnotationProvider) GetAnnotations(component radixv1.RadixCommonDeployComponent, _ string) (map[string]string, error) {
if network := component.GetNetwork(); network == nil || network.Ingress == nil || network.Ingress.Public == nil || network.Ingress.Public.Allow == nil || len(*network.Ingress.Public.Allow) == 0 {
return nil, nil
Expand Down

0 comments on commit 2dfd3c5

Please sign in to comment.