diff --git a/go.mod b/go.mod index eb9a721..a01b8de 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/onsi/ginkgo/v2 v2.27.2 github.com/onsi/gomega v1.38.2 github.com/open-edge-platform/cluster-connect-gateway v1.2.4 - github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1 + github.com/open-edge-platform/infra-core/inventory/v2 v2.32.0 github.com/open-edge-platform/orch-library/go v0.6.1 github.com/open-policy-agent/opa v1.10.1 github.com/rs/zerolog v1.34.0 diff --git a/go.sum b/go.sum index 25176e2..3d405ca 100644 --- a/go.sum +++ b/go.sum @@ -771,8 +771,8 @@ github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6u github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-edge-platform/cluster-connect-gateway v1.2.4 h1:SBr2xXhMlCOFOrDjZPAvBySEeI5TW6AgqqDcihBhFsc= github.com/open-edge-platform/cluster-connect-gateway v1.2.4/go.mod h1:QDYeLlziDltMzqLtobbqUZJcxyGl9LmmXx/fUhH1RqQ= -github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1 h1:k2yEmRfqhKABJNYG7bV+D5eJ5CnG50S3j1yZ8sWdZu8= -github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1/go.mod h1:7bHaRxSL+e5XFt2cGCFS3DuI405Nz2u6q0vlMv6/twY= +github.com/open-edge-platform/infra-core/inventory/v2 v2.32.0 h1:u5hVoEpTiD5JL4jTYA1DJ5iXM4t4WULd8Rwn7mfPqSQ= +github.com/open-edge-platform/infra-core/inventory/v2 v2.32.0/go.mod h1:7bHaRxSL+e5XFt2cGCFS3DuI405Nz2u6q0vlMv6/twY= github.com/open-edge-platform/orch-library/go v0.6.1 h1:IGR2ic73f3obnhlxTRfHcyYMbPbYu7BSqa9UYyEZ78Q= github.com/open-edge-platform/orch-library/go v0.6.1/go.mod h1:3Tes/GJfwYbnQa/1scbKiLbjZrL4fJEouFk28oo5/c8= github.com/open-edge-platform/orch-library/go/dazl v0.5.4 h1:Rx/bSAZiLjEEBjUiJEzBvT0fQv5huT5FQ2Ke3IMUhiE= diff --git a/pkg/inventory/inventory_client_test.go b/pkg/inventory/inventory_client_test.go index 72b1cc8..f30fccf 100644 --- a/pkg/inventory/inventory_client_test.go +++ b/pkg/inventory/inventory_client_test.go @@ -59,7 +59,7 @@ func TestGetHostAndInstanceByHostUUID(t *testing.T) { SerialNumber: hostSerialNumber, Instance: &computev1.InstanceResource{ ResourceId: instanceResourceId, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: instanceOsName, }, }, @@ -72,7 +72,7 @@ func TestGetHostAndInstanceByHostUUID(t *testing.T) { SerialNumber: hostSerialNumber, Instance: &computev1.InstanceResource{ ResourceId: instanceResourceId, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: instanceOsName, }, }, @@ -94,7 +94,7 @@ func TestGetHostAndInstanceByHostUUID(t *testing.T) { assert.Equal(t, tc.expectedHost.GetSerialNumber(), host.GetSerialNumber()) require.NotNil(t, host.GetInstance()) assert.Equal(t, tc.expectedHost.GetInstance().GetResourceId(), host.GetInstance().GetResourceId()) - assert.Equal(t, tc.expectedHost.GetInstance().GetCurrentOs().GetName(), host.GetInstance().GetCurrentOs().GetName()) + assert.Equal(t, tc.expectedHost.GetInstance().GetOs().GetName(), host.GetInstance().GetOs().GetName()) }) } } @@ -171,7 +171,7 @@ func TestGetInstance(t *testing.T) { tenantId: tenantId, expectedInstance: &computev1.InstanceResource{ ResourceId: instanceResourceId, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: instanceOsName, }, }, @@ -183,7 +183,7 @@ func TestGetInstance(t *testing.T) { Resource: &inventoryv1.Resource_Instance{ Instance: &computev1.InstanceResource{ ResourceId: instanceResourceId, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: instanceOsName, }, }, @@ -204,7 +204,7 @@ func TestGetInstance(t *testing.T) { require.Nil(t, err) require.NotNil(t, out) assert.Equal(t, out.GetResourceId(), tc.instanceId) - assert.Equal(t, tc.expectedInstance.GetCurrentOs().GetName(), out.GetCurrentOs().GetName()) + assert.Equal(t, tc.expectedInstance.GetOs().GetName(), out.GetOs().GetName()) }) } } diff --git a/pkg/inventory/machine_provider.go b/pkg/inventory/machine_provider.go index 23ee819..6ccb0da 100644 --- a/pkg/inventory/machine_provider.go +++ b/pkg/inventory/machine_provider.go @@ -108,7 +108,7 @@ func (n *MachineProvider) GetInstanceByMachineId(in GetInstanceByMachineIdInput) &Instance{ Id: instance.GetResourceId(), SerialNo: host.GetSerialNumber(), - Os: instance.GetCurrentOs().GetName(), + Os: instance.GetOs().GetName(), MachineId: in.MachineId}, nil} } diff --git a/pkg/inventory/machine_provider_test.go b/pkg/inventory/machine_provider_test.go index 811778d..a93c394 100644 --- a/pkg/inventory/machine_provider_test.go +++ b/pkg/inventory/machine_provider_test.go @@ -305,7 +305,7 @@ func TestGetInstanceByMachineId(t *testing.T) { SerialNumber: hostSerialNumber, Instance: &computev1.InstanceResource{ ResourceId: instanceResourceId, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: instanceOsName, }, }, diff --git a/test/inventory-stub/inventory_stub.go b/test/inventory-stub/inventory_stub.go index 1370f3b..cd1daef 100644 --- a/test/inventory-stub/inventory_stub.go +++ b/test/inventory-stub/inventory_stub.go @@ -324,7 +324,7 @@ func GetStubClient() client.TenantAwareInventoryClient { Response: &computev1.HostResource{ Instance: &computev1.InstanceResource{ ResourceId: defaultInstanceID, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: "Linux", }, }, @@ -341,7 +341,7 @@ func GetStubClient() client.TenantAwareInventoryClient { Resource: &inv_v1.Resource_Instance{ Instance: &computev1.InstanceResource{ ResourceId: defaultInstanceID, - CurrentOs: &osv1.OperatingSystemResource{ + Os: &osv1.OperatingSystemResource{ Name: "Linux", }, WorkloadMembers: []*computev1.WorkloadMember{ diff --git a/test/inventory-stub/inventory_stub_test.go b/test/inventory-stub/inventory_stub_test.go index 3f5d893..41cf42a 100644 --- a/test/inventory-stub/inventory_stub_test.go +++ b/test/inventory-stub/inventory_stub_test.go @@ -21,7 +21,7 @@ func TestGetHostByUUID(t *testing.T) { require.NoError(t, err) require.NotNil(t, host) assert.Equal(t, defaultInstanceID, host.Instance.ResourceId) - assert.Equal(t, "Linux", host.Instance.CurrentOs.Name) + assert.Equal(t, "Linux", host.Instance.Os.Name) assert.Equal(t, "SN123456", host.SerialNumber) } @@ -31,7 +31,7 @@ func TestGet(t *testing.T) { require.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, defaultInstanceID, resp.Resource.GetInstance().ResourceId) - assert.Equal(t, "Linux", resp.Resource.GetInstance().CurrentOs.Name) + assert.Equal(t, "Linux", resp.Resource.GetInstance().Os.Name) } func TestCreate(t *testing.T) {