Skip to content

Commit

Permalink
Merge pull request #183 from microsoft/user/vishalk/add-osversion
Browse files Browse the repository at this point in the history
Add OsVersion to Tags
  • Loading branch information
vishal-kadam authored Oct 18, 2023
2 parents bb185cc + 72327f9 commit f07e232
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ const (
CertificateValidityThreshold float64 = (30.0 / 100.0)
RenewalBackoff float64 = (2.0 / 100.0)
OsRegistrationStatus string = "osRegistrationStatus"
OsVersion string = "osVersion"
)
7 changes: 7 additions & 0 deletions services/cloud/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func getNodeStatuses(node *wssdcloud.Node) map[string]*string {
func generateNodeTags(node *wssdcloud.Node) map[string]*string {
tags := make(map[string]*string)
populateOsRegistrationStatusTag(tags, node)
populateOsVersionTag(tags, node)
if len(tags) > 0 {
return tags
}
Expand All @@ -94,3 +95,9 @@ func populateOsRegistrationStatusTag(tags map[string]*string, node *wssdcloud.No
tags[constant.OsRegistrationStatus] = &osRegistrationStatus
}
}

func populateOsVersionTag(tags map[string]*string, node *wssdcloud.Node) {
if node.Info != nil && node.Info.OsInfo != nil {
tags[constant.OsVersion] = &node.Info.OsInfo.Osversion
}
}

0 comments on commit f07e232

Please sign in to comment.