Skip to content

Commit

Permalink
Fetch Vsphere instanceUuid
Browse files Browse the repository at this point in the history
Signed-off-by: Ondra Machacek <[email protected]>
  • Loading branch information
machacekondra committed Nov 27, 2024
1 parent 840fa31 commit 8a08a19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/provider/container/vsphere/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ func (r *Collector) getUpdates(ctx context.Context) error {
about := r.client.ServiceContent.About
err = r.db.Insert(
&model.About{
APIVersion: about.ApiVersion,
Product: about.LicenseProductName,
APIVersion: about.ApiVersion,
Product: about.LicenseProductName,
InstanceUuid: about.InstanceUuid,
})
if err != nil {
return err
Expand Down
5 changes: 3 additions & 2 deletions pkg/controller/provider/model/vsphere/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ func (m *Base) GetName() string {

type About struct {
Base
APIVersion string `sql:""`
Product string `sql:""`
APIVersion string `sql:""`
Product string `sql:""`
InstanceUuid string `sql:""`
}

type Folder struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/provider/web/vsphere/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (h ProviderHandler) AddDerived(r *Provider) (err error) {
}
r.APIVersion = about.APIVersion
r.Product = about.Product
r.InstanceUuid = about.InstanceUuid
// Datacenter
n, err = db.Count(&vsphere.Datacenter{}, nil)
if err != nil {
Expand Down Expand Up @@ -187,6 +188,7 @@ type Provider struct {
Object api.Provider `json:"object"`
APIVersion string `json:"apiVersion"`
Product string `json:"product"`
InstanceUuid string `json:"instanceUuid"`
DatacenterCount int64 `json:"datacenterCount"`
ClusterCount int64 `json:"clusterCount"`
HostCount int64 `json:"hostCount"`
Expand Down

0 comments on commit 8a08a19

Please sign in to comment.