Skip to content

Commit

Permalink
server: revert non-standalone VW URL
Browse files Browse the repository at this point in the history
Partially reverts logic introduced in kcp-dev#2407 so we don't unconditionally
use the external URL - when non-standalone VW mode is used we still
need the old behavior, or the loopback client can't access the VW
server.

This breaks shard bootstrapping (evidently not in our e2e scenarios,
but in a real deployment where probes mean the proxy isn't ready until
the shard bootstrap is complete)
  • Loading branch information
Steven Hardy committed Jan 24, 2023
1 parent 7b3126c commit 82bebb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/server/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,10 @@ func (s *Server) installAPIBinderController(ctx context.Context, config *rest.Co
// Client used to create APIBindings within the initializing workspace
config = rest.CopyConfig(config)
config = rest.AddUserAgent(config, initialization.ControllerName)
config.Host += initializingworkspacesbuilder.URLFor(tenancyv1alpha1.WorkspaceAPIBindingsInitializer)

vwURL := fmt.Sprintf("https://%s", s.GenericConfig.ExternalAddress)
if !s.Options.Virtual.Enabled && s.Options.Extra.ShardVirtualWorkspaceURL != "" {
vwURL := fmt.Sprintf("https://%s", s.GenericConfig.ExternalAddress)
if s.Options.Extra.ShardVirtualWorkspaceCAFile == "" {
// TODO move verification up
return fmt.Errorf("s.Options.Extra.ShardVirtualWorkspaceCAFile is required")
Expand All @@ -829,9 +830,9 @@ func (s *Server) installAPIBinderController(ctx context.Context, config *rest.Co
config.TLSClientConfig.CAFile = s.Options.Extra.ShardVirtualWorkspaceCAFile
config.TLSClientConfig.CertFile = s.Options.Extra.ShardClientCertFile
config.TLSClientConfig.KeyFile = s.Options.Extra.ShardClientKeyFile
config.Host = fmt.Sprintf("%v%v", vwURL, initializingworkspacesbuilder.URLFor(tenancyv1alpha1.WorkspaceAPIBindingsInitializer))
}

config.Host = fmt.Sprintf("%v%v", vwURL, initializingworkspacesbuilder.URLFor(tenancyv1alpha1.WorkspaceAPIBindingsInitializer))
initializingWorkspacesKcpClusterClient, err := kcpclientset.NewForConfig(config)
if err != nil {
return err
Expand Down

0 comments on commit 82bebb1

Please sign in to comment.