Skip to content

Commit 84d856f

Browse files
committed
--external-address is optional and not set in e2e tests
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 3e5dbd1 commit 84d856f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

backend/kubernetes/resources/kubeconfig.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,14 @@ func GenerateKubeconfig(ctx context.Context,
141141
// and is dependent on the provider.
142142
type ExternalAddressGeneratorFunc func(ctx context.Context, clusterConfig *rest.Config) (string, error)
143143

144-
// FixedExternalAddressGenerator returns an address generator that ignores its input and always returns
145-
// the same address.
144+
// FixedExternalAddressGenerator returns an address generator uses the given address when available,
145+
// otherwise falls back to the host of the provided rest config.
146146
func NewFixedExternalAddressGenerator(address string) ExternalAddressGeneratorFunc {
147-
return func(_ context.Context, _ *rest.Config) (string, error) {
147+
return func(_ context.Context, clusterConfig *rest.Config) (string, error) {
148+
if address == "" {
149+
return clusterConfig.Host, nil
150+
}
151+
148152
return address, nil
149153
}
150154
}

0 commit comments

Comments
 (0)