Skip to content

Commit

Permalink
Use a much simpler initialization process for controller. (#912)
Browse files Browse the repository at this point in the history
* Use a much simpler initialization process for controller.

* We can delay this a bit.
  • Loading branch information
joel-rieke committed Jan 26, 2024
1 parent 4cc01c3 commit e0ce721
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions atrium/vestibulum/trcshbase/trcsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ func acceptRemote(featherCtx *cap.FeatherContext, mode int, remote string) (bool
}

func featherCtlCb(featherCtx *cap.FeatherContext, agentName string) error {

if gAgentConfig == nil {
return errors.New("incorrect agent initialization")
}
Expand All @@ -411,6 +410,9 @@ func featherCtlCb(featherCtx *cap.FeatherContext, agentName string) error {
return errors.New("incorrect feathering")
}

// Initialize supoorted deployers.
deployopts.BuildOptions.InitSupportedDeployers([]string{agentName})

if sessionIdentifier, ok := deployopts.BuildOptions.GetEncodedDeployerId(agentName, *featherCtx.Env); ok {
featherCtx.SessionIdentifier = &sessionIdentifier
featherCtx.Log.Printf("Starting deploy ctl session: %s\n", sessionIdentifier)
Expand Down Expand Up @@ -724,15 +726,6 @@ func ProcessDeploy(featherCtx *cap.FeatherContext, config *eUtils.DriverConfig,
config.EndDir = "."
config.Log.Printf("Preloading path %s env %s\n", trcPath, config.EnvRaw)

// Initialize deployers.
deployments, err := deployutil.GetDeployers(config)
if err != nil {
fmt.Println("Error could not load deployers. Invalid installation.")
config.Log.Printf("Error could not load deployers. Invalid installation.\n")
os.Exit(-1)
}
deployopts.BuildOptions.InitSupportedDeployers(deployments)

configErr := trcconfigbase.CommonMain(&config.EnvRaw, &mergedVaultAddress, &token, &mergedEnvRaw, &configRoleSlice[1], &configRoleSlice[0], &tokenName, &region, nil, []string{"trcsh"}, config)
if configErr != nil {
fmt.Println("Preload failed. Couldn't find required resource.")
Expand Down

0 comments on commit e0ce721

Please sign in to comment.