Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM, NIC and disk hydration #237

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2567747
protobuf change for node agent VM hydration
neerajdixit-msft2 Feb 14, 2024
f58a10d
add VM dicovery protobuf changes
neerajdixit-msft2 Mar 26, 2024
2c45b36
add VM discovery protobuf changes for cloudagent
katl-msft Apr 3, 2024
22bb542
add VM discovery protobuf changes for cloudagent
katl-msft Apr 3, 2024
d22f44f
Revert "add VM discovery protobuf changes for cloudagent"
katl-msft Apr 3, 2024
2e22ede
Merge pull request #256 from microsoft/users/katlynho/VmHydration
katl-msft Apr 4, 2024
ddd716a
hydrate vhd object changes
neerajdixit-msft2 Apr 16, 2024
2595b00
Fix crash in mocctl show, need to uncomment all VM structure members
neerajdixit-msft2 Apr 23, 2024
e0a276d
Merge pull request #261 from microsoft/users/ndixit/CloudAgentBugFixes
neerajdixit-msft2 May 2, 2024
644126d
protobuf change for node agent VM hydration
neerajdixit-msft2 Feb 14, 2024
8e5f774
add VM dicovery protobuf changes
neerajdixit-msft2 Mar 26, 2024
3874ecf
add VM discovery protobuf changes for cloudagent
katl-msft Apr 3, 2024
e7931c7
Revert "add VM discovery protobuf changes for cloudagent"
katl-msft Apr 3, 2024
c32f10a
add VM discovery protobuf changes for cloudagent
katl-msft Apr 3, 2024
3f56ed6
hydrate vhd object changes
neerajdixit-msft2 Apr 16, 2024
9d385c0
Fix crash in mocctl show, need to uncomment all VM structure members
neerajdixit-msft2 Apr 23, 2024
f04e8d5
rebase conflict fixes
katl-msft Jun 1, 2024
4881b8d
Merge branch 'users/trailblazer/VmHydration' into users/katlynho/mast…
katl-msft Jun 1, 2024
b5ac1e6
Merge pull request #263 from microsoft/users/katlynho/masterMerge
mduppre Jun 24, 2024
d715cb8
Update generated go files after catch-up merge with master
mduppre Jun 24, 2024
d200305
Merge branch 'main' into users/trailblazer/VmHydration
yingzhan-msft Jul 29, 2024
ed8ccfc
Remove discovery
mduppre Jul 30, 2024
de33cc4
address review comments
neerajdixit-msft2 Aug 9, 2024
62d02a7
add discover option in node agent
neerajdixit-msft2 Aug 21, 2024
bee5fc8
Merge pull request #286 from microsoft/users/ndixit/DiskNicIdinVm
neerajdixit-msft2 Aug 22, 2024
20b5ade
Go back to go.mod and go.sum from main
mduppre Sep 6, 2024
6051be6
Merge branch 'main' into users/trailblazer/VmHydration
mduppre Sep 6, 2024
25947e4
Add new hydrated state for bootstrapengine
mduppre Sep 22, 2024
bccf6b6
Merge pull request #297 from microsoft/users/mduppre/bug_fix
mduppre Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions pkg/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,46 @@ func SetValidationStatus(s *common.Status, validationState []*common.ValidationS
}

func GetValidationStatus(s *common.Status) []*common.ValidationState {
return s.GetValidationStatus().GetValidationState()
validationStatus := s.GetValidationStatus()
if validationStatus != nil {
return validationStatus.GetValidationState()
}
return nil
}

// GetStatuses - converts status to map
func GetStatuses(status *common.Status) map[string]*string {
statuses := map[string]*string{}
pstate := status.GetProvisioningStatus().String()
statuses["ProvisionState"] = &pstate
hstate := status.GetHealth().String()
statuses["HealthState"] = &hstate
estate := status.GetLastError().String()
statuses["Error"] = &estate
version := status.GetVersion().Number
statuses["Version"] = &version
dstate := status.GetDownloadStatus().String()
statuses["DownloadStatus"] = &dstate

provisionStatus := status.GetProvisioningStatus()
if provisionStatus != nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are skipping (not adding into the map) if provisionStatus== nil? Is everyone aware of status map may not contains some statuses. or should we add the empty string for provisionStatus? Same approach should apply next 4 statuses.

provisionStatusStr := provisionStatus.String()
statuses["ProvisionState"] = &provisionStatusStr
}

healthStatus := status.GetHealth()
if healthStatus != nil {
healthStatusStr := healthStatus.String()
statuses["HealthState"] = &healthStatusStr
}

errorStatus := status.GetLastError()
if errorStatus != nil {
errorStatusStr := errorStatus.String()
statuses["Error"] = &errorStatusStr
}

version := status.GetVersion()
if version != nil {
statuses["Version"] = &version.Number
}

downloadStatus := status.GetDownloadStatus()
if downloadStatus != nil {
downloadStatusStr := downloadStatus.String()
statuses["DownloadStatus"] = &downloadStatusStr
}

return statuses
}

Expand Down
Loading
Loading