2323package v1alpha
2424
2525import (
26- "fmt"
27- "net/url"
28-
2926 "github.com/arangodb/kube-arangodb/pkg/util"
3027)
3128
@@ -37,8 +34,6 @@ type ExternalAccessSpec struct {
3734 NodePort * int `json:"nodePort,omitempty"`
3835 // Optional IP used to configure a load-balancer on, in case of Auto or LoadBalancer type.
3936 LoadBalancerIP * string `json:"loadBalancerIP,omitempty"`
40- // Advertised Endpoint is passed to the coordinators/single servers for advertising a specific endpoint
41- AdvertisedEndpoint * string `json:"advertisedEndpoint,omitempty"`
4237}
4338
4439// GetType returns the value of type.
@@ -56,27 +51,11 @@ func (s ExternalAccessSpec) GetLoadBalancerIP() string {
5651 return util .StringOrDefault (s .LoadBalancerIP )
5752}
5853
59- // GetAdvertisedEndpoint returns the advertised endpoint or empty string if none was specified
60- func (s ExternalAccessSpec ) GetAdvertisedEndpoint () string {
61- return util .StringOrDefault (s .AdvertisedEndpoint )
62- }
63-
64- // HasAdvertisedEndpoint return whether an advertised endpoint was specified or not
65- func (s ExternalAccessSpec ) HasAdvertisedEndpoint () bool {
66- return s .AdvertisedEndpoint != nil
67- }
68-
6954// Validate the given spec
7055func (s ExternalAccessSpec ) Validate () error {
7156 if err := s .GetType ().Validate (); err != nil {
7257 return maskAny (err )
7358 }
74- if s .AdvertisedEndpoint != nil {
75- ep := s .GetAdvertisedEndpoint ()
76- if _ , err := url .Parse (ep ); err != nil {
77- return maskAny (fmt .Errorf ("Failed to parse advertised endpoint '%s': %s" , ep , err ))
78- }
79- }
8059 return nil
8160}
8261
@@ -95,21 +74,11 @@ func (s *ExternalAccessSpec) SetDefaultsFrom(source ExternalAccessSpec) {
9574 if s .LoadBalancerIP == nil {
9675 s .LoadBalancerIP = util .NewStringOrNil (source .LoadBalancerIP )
9776 }
98- if s .AdvertisedEndpoint == nil {
99- s .AdvertisedEndpoint = source .AdvertisedEndpoint
100- }
10177}
10278
10379// ResetImmutableFields replaces all immutable fields in the given target with values from the source spec.
10480// It returns a list of fields that have been reset.
10581// Field names are relative to given field prefix.
10682func (s ExternalAccessSpec ) ResetImmutableFields (fieldPrefix string , target * ExternalAccessSpec ) []string {
107- var resetFields []string
108-
109- // THIS SHOULD NOT BE IMMUTABLE!
110- if s .GetAdvertisedEndpoint () != target .GetAdvertisedEndpoint () {
111- target .AdvertisedEndpoint = util .NewStringOrNil (s .AdvertisedEndpoint )
112- resetFields = append (resetFields , fieldPrefix + ".advertisedEndpoint" )
113- }
11483 return nil
11584}
0 commit comments