From 378fbb3f4433e089a2c5e1d9301df0588992cc4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:00:25 +0000 Subject: [PATCH 1/2] [gomod] bump github.com/open-edge-platform/infra-core/inventory/v2 Bumps [github.com/open-edge-platform/infra-core/inventory/v2](https://github.com/open-edge-platform/infra-core) from 2.31.1 to 2.32.0. - [Release notes](https://github.com/open-edge-platform/infra-core/releases) - [Commits](https://github.com/open-edge-platform/infra-core/compare/inventory/v2.31.1...inventory/v2.32.0) --- updated-dependencies: - dependency-name: github.com/open-edge-platform/infra-core/inventory/v2 dependency-version: 2.32.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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= From 3892f9ef744ffdac55b9e1945c36ecac3780bd1d Mon Sep 17 00:00:00 2001 From: togashidm Date: Thu, 6 Nov 2025 15:11:55 +0000 Subject: [PATCH 2/2] fix: rename CurrentOs to Os github.com/open-edge-platform/infra-core/inventory/v2 version 2.32.0 included a breaking API change. make test was failing because the dependency update. This commit fix by renaming the field CurrentOs in the InstanceResource struct to Os --- pkg/inventory/inventory_client_test.go | 12 ++++++------ pkg/inventory/machine_provider.go | 2 +- pkg/inventory/machine_provider_test.go | 2 +- test/inventory-stub/inventory_stub.go | 4 ++-- test/inventory-stub/inventory_stub_test.go | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) 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) {