Skip to content

Commit d977d06

Browse files
author
lamai93
committed
Revert "Advertise endpoint if set in spec. Immutable."
This reverts commit e183277.
1 parent e183277 commit d977d06

File tree

4 files changed

+1
-47
lines changed

4 files changed

+1
-47
lines changed

pkg/apis/deployment/v1alpha/external_access_spec.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
package v1alpha
2424

2525
import (
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
7055
func (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.
10682
func (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
}

pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/deployment/reconcile/action_cleanout_member.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (a *actionCleanoutMember) CheckProgress(ctx context.Context) (bool, bool, e
9797
}
9898
// do not try to clean out a pod that was not initialized
9999
if !m.IsInitialized {
100-
return true, false, nil
100+
return false, true, nil
101101
}
102102
c, err := a.actionCtx.GetDatabaseClient(ctx)
103103
if err != nil {

pkg/deployment/resources/pod_creator.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ func createArangodArgs(apiObject metav1.Object, deplSpec api.DeploymentSpec, gro
180180
optionPair{"--foxx.queues", "true"},
181181
optionPair{"--server.statistics", "true"},
182182
)
183-
if deplSpec.ExternalAccess.HasAdvertisedEndpoint() {
184-
options = append(options,
185-
optionPair{"--cluster.my-advertised-endpoint", deplSpec.ExternalAccess.GetAdvertisedEndpoint()},
186-
)
187-
}
188183
case api.ServerGroupSingle:
189184
options = append(options,
190185
optionPair{"--foxx.queues", "true"},
@@ -197,11 +192,6 @@ func createArangodArgs(apiObject metav1.Object, deplSpec api.DeploymentSpec, gro
197192
optionPair{"--cluster.my-address", myTCPURL},
198193
optionPair{"--cluster.my-role", "SINGLE"},
199194
)
200-
if deplSpec.ExternalAccess.HasAdvertisedEndpoint() {
201-
options = append(options,
202-
optionPair{"--cluster.my-advertised-endpoint", deplSpec.ExternalAccess.GetAdvertisedEndpoint()},
203-
)
204-
}
205195
}
206196
}
207197
if addAgentEndpoints {

0 commit comments

Comments
 (0)