Skip to content

Commit

Permalink
Merge pull request #4027 from MaxMcAdam/anax-3986
Browse files Browse the repository at this point in the history
Issue 3986 - AgentImageCleanup: Agent handles new type of NMP
  • Loading branch information
LiilyZhang authored Apr 22, 2024
2 parents 6c81194 + cd8f042 commit ec8b458
Show file tree
Hide file tree
Showing 3 changed files with 421 additions and 390 deletions.
19 changes: 19 additions & 0 deletions exchangecommon/node_management_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type ExchangeNodeManagementPolicy struct {
PolicyUpgradeTime string `json:"start"`
UpgradeWindowDuration int `json:"startWindow"`
AgentAutoUpgradePolicy *ExchangeAgentUpgradePolicy `json:"agentUpgradePolicy,omitempty"`
AgentImagePolicy *ExchangeAgentImagePolicy `json:"agentImagePolicy,omitempty"`
LastUpdated string `json:"lastUpdated,omitempty"`
Created string `json:"created,omitempty"`
}
Expand Down Expand Up @@ -135,3 +136,21 @@ type AgentFileVersions struct {
func (a AgentFileVersions) String() string {
return fmt.Sprintf("SoftwareVersions: %v, ConfigVersions: %v, CertVersions: %v", a.SoftwareVersions, a.ConfigVersions, a.CertVersions)
}

type ExchangeAgentImagePolicy struct {
Removal []ImageRemovalPolicy `json:"imageRemovalPolicies,omitempty"`
}

func (e ExchangeAgentImagePolicy) String() string {
str := "Removal: "
for _, pol := range e.Removal {
str = str + fmt.Sprintf(" %v", pol)
}
return str
}

type ImageRemovalPolicy struct {
ImageId string `json:"imageId"`
DeleteAfterMinutes uint64 `json:"deleteAfterMinutes"`
AgentDownloadedOnly bool `json:"agentDownloadedOnly"`
}
Loading

0 comments on commit ec8b458

Please sign in to comment.