CloneConfig makes a copy of SubAgent using configuration from the devcontainer. The ID is inherited from dc.SubagentID if present, and the name is inherited from the devcontainer. AuthToken is not copied.
(dc codersdk.WorkspaceAgentDevcontainer)
| 28 | // devcontainer. The ID is inherited from dc.SubagentID if present, and |
| 29 | // the name is inherited from the devcontainer. AuthToken is not copied. |
| 30 | func (s SubAgent) CloneConfig(dc codersdk.WorkspaceAgentDevcontainer) SubAgent { |
| 31 | return SubAgent{ |
| 32 | ID: dc.SubagentID.UUID, |
| 33 | Name: dc.Name, |
| 34 | Directory: s.Directory, |
| 35 | Architecture: s.Architecture, |
| 36 | OperatingSystem: s.OperatingSystem, |
| 37 | DisplayApps: slices.Clone(s.DisplayApps), |
| 38 | Apps: slices.Clone(s.Apps), |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func (s SubAgent) EqualConfig(other SubAgent) bool { |
| 43 | return s.Name == other.Name && |