Skip to content

Commit 5ae6633

Browse files
authored
chore: bump inventory/v2 (#224)
1 parent 383e122 commit 5ae6633

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/onsi/ginkgo/v2 v2.27.2
1919
github.com/onsi/gomega v1.38.2
2020
github.com/open-edge-platform/cluster-api-provider-intel v1.2.6
21-
github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1
21+
github.com/open-edge-platform/infra-core/inventory/v2 v2.33.0
2222
github.com/open-edge-platform/orch-library/go v0.6.1
2323
github.com/open-edge-platform/orch-utils/tenancy-datamodel v1.2.2
2424
github.com/rancher/cluster-api-provider-rke2 v0.21.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
400400
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
401401
github.com/open-edge-platform/cluster-api-provider-intel v1.2.6 h1:7PGTWe81hp+j6hppO9bAcvMITaeJ9Xtkk53stpF7DIA=
402402
github.com/open-edge-platform/cluster-api-provider-intel v1.2.6/go.mod h1:Ix3pqvAbazFwwOUHPibXOh7iMtDy5CHgoji6PZ9rVcg=
403-
github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1 h1:k2yEmRfqhKABJNYG7bV+D5eJ5CnG50S3j1yZ8sWdZu8=
404-
github.com/open-edge-platform/infra-core/inventory/v2 v2.31.1/go.mod h1:7bHaRxSL+e5XFt2cGCFS3DuI405Nz2u6q0vlMv6/twY=
403+
github.com/open-edge-platform/infra-core/inventory/v2 v2.33.0 h1:O4Po4HotscUoXtAuqRiayTGEI8yMpbn3mozIfY/DT/4=
404+
github.com/open-edge-platform/infra-core/inventory/v2 v2.33.0/go.mod h1:wqp3Ai89I7FgEBUauiRwunxb6AJaS1rf8rgI3Rbt4Yo=
405405
github.com/open-edge-platform/orch-library/go v0.6.1 h1:IGR2ic73f3obnhlxTRfHcyYMbPbYu7BSqa9UYyEZ78Q=
406406
github.com/open-edge-platform/orch-library/go v0.6.1/go.mod h1:3Tes/GJfwYbnQa/1scbKiLbjZrL4fJEouFk28oo5/c8=
407407
github.com/open-edge-platform/orch-library/go/dazl v0.5.4 h1:Rx/bSAZiLjEEBjUiJEzBvT0fQv5huT5FQ2Ke3IMUhiE=

internal/inventory/grpc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ func (c *InventoryClient) IsImmutable(ctx context.Context, tenantId, hostUuid st
9797
return false, errors.New("host instance is nil")
9898
}
9999

100-
if host.Instance.DesiredOs == nil {
101-
return false, errors.New("host instance desired os is nil")
100+
if host.Instance.Os == nil {
101+
return false, errors.New("host instance os is nil")
102102
}
103103

104104
// The expectation is when the host OS is immutable, we expect the k3s packages to be bundled as part of the
105105
// OS image. So, we assume that the cluster is installed in air-gap mode.
106-
// return host.Instance.DesiredOs.OsType == osv1.OsType_OS_TYPE_IMMUTABLE, nil
106+
// return host.Instance.Os.OsType == osv1.OsType_OS_TYPE_IMMUTABLE, nil
107107
// Always return false for now as we don't support immutable EMT with pre-installed K3s packages yet
108108
return false, nil
109109
}

internal/inventory/inventory_test/grpc_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ func TestIsImmutable(t *testing.T) {
151151
return mockClient, nil
152152
}
153153

154-
immutableHost := &computev1.HostResource{Instance: &computev1.InstanceResource{DesiredOs: &osv1.OperatingSystemResource{OsType: osv1.OsType_OS_TYPE_IMMUTABLE}}}
155-
mutableHost := &computev1.HostResource{Instance: &computev1.InstanceResource{DesiredOs: &osv1.OperatingSystemResource{OsType: osv1.OsType_OS_TYPE_MUTABLE}}}
154+
immutableHost := &computev1.HostResource{Instance: &computev1.InstanceResource{Os: &osv1.OperatingSystemResource{OsType: osv1.OsType_OS_TYPE_IMMUTABLE}}}
155+
mutableHost := &computev1.HostResource{Instance: &computev1.InstanceResource{Os: &osv1.OperatingSystemResource{OsType: osv1.OsType_OS_TYPE_MUTABLE}}}
156156
nilInstance := &computev1.HostResource{Instance: nil}
157-
desiredOsNil := &computev1.HostResource{Instance: &computev1.InstanceResource{DesiredOs: nil}}
157+
osNil := &computev1.HostResource{Instance: &computev1.InstanceResource{Os: nil}}
158158

159159
cases := []struct {
160160
name string
@@ -203,12 +203,12 @@ func TestIsImmutable(t *testing.T) {
203203
expectedErr: errors.New("host instance is nil"),
204204
},
205205
{
206-
name: "desired OS nil",
206+
name: "os nil",
207207
mock: func() {
208-
mockClient.EXPECT().GetHostByUUID(mock.Anything, mock.Anything, mock.Anything).Return(desiredOsNil, nil).Once()
208+
mockClient.EXPECT().GetHostByUUID(mock.Anything, mock.Anything, mock.Anything).Return(osNil, nil).Once()
209209
},
210210
expectedVal: false,
211-
expectedErr: errors.New("host instance desired os is nil"),
211+
expectedErr: errors.New("host instance os is nil"),
212212
},
213213
{
214214
name: "error fetching host",

0 commit comments

Comments
 (0)