Skip to content

Commit

Permalink
Merge pull request #50 from site0801/fix/clear-instance-source-server…
Browse files Browse the repository at this point in the history
…-in-pool-agent

Clear instance source server in pool-agent config
  • Loading branch information
whywaita authored Dec 13, 2024
2 parents f696094 + c5a07f8 commit c1fe576
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pool-agent/cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func newAgent(ctx context.Context) (*Agent, error) {
if err != nil {
return nil, err
}
source.Server = ""

c, err := lxd.ConnectLXDUnixWithContext(ctx, "", &lxd.ConnectionArgs{})
if err != nil {
return nil, fmt.Errorf("connect lxd: %w", err)
Expand Down Expand Up @@ -110,6 +112,7 @@ func (a *Agent) reloadConfig() error {
return fmt.Errorf("parse image alias: %w", err)
}
a.InstanceSource = *source
a.InstanceSource.Server = ""
a.ImageAlias = conf.ImageAlias
}
a.ResourceTypesMap = conf.ResourceTypesMap
Expand Down Expand Up @@ -213,7 +216,7 @@ func (a *Agent) adjustInstancePool() error {
}

for _, i := range s {
if i.Config[configKeyResourceType] == "" || i.Config[configKeyImageAlias] == "" || i.Config[configKeyRunnerName] == "" {
if i.Config[configKeyResourceType] == "" || i.Config[configKeyImageAlias] == "" {
continue
}
l := slog.With("instance", i.Name)
Expand Down

0 comments on commit c1fe576

Please sign in to comment.