Skip to content

Commit 8bf98ea

Browse files
authored
fix(COD-4672): Default to Installed if apiInfo is nil (#1687)
1 parent 77950ff commit 8bf98ea

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lwcomponent/catalog_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestCatalogNewCatalog(t *testing.T) {
8787
assert.Nil(t, err)
8888
})
8989

90-
t.Run("installed", func(t *testing.T) {
90+
t.Run("installed when ApiInfo is nil", func(t *testing.T) {
9191
fakeServer := lacework.MockServer()
9292
defer fakeServer.Close()
9393

@@ -394,9 +394,9 @@ func TestCatalogGetComponent(t *testing.T) {
394394
assert.Equal(t, version, ver.String())
395395
})
396396

397-
t.Run("installed deprecated", func(t *testing.T) {
397+
t.Run("installed when ApiInfo is nil", func(t *testing.T) {
398398
var (
399-
name = "installed deprecated"
399+
name = "installed"
400400
version = "1.1.0"
401401
)
402402

@@ -411,7 +411,7 @@ func TestCatalogGetComponent(t *testing.T) {
411411
component, err := catalog.GetComponent(name)
412412
assert.NotNil(t, component)
413413
assert.Nil(t, err)
414-
assert.Equal(t, lwcomponent.InstalledDeprecated, component.Status)
414+
assert.Equal(t, lwcomponent.Installed, component.Status)
415415

416416
ver := component.InstalledVersion()
417417
assert.Equal(t, version, ver.String())

lwcomponent/cdk_component.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func status(apiInfo *ApiInfo, hostInfo *HostInfo) Status {
210210
return Installed
211211
}
212212
} else {
213-
return InstalledDeprecated
213+
return Installed
214214
}
215215
}
216216

lwcomponent/cdk_component_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func TestNewCDKComponent(t *testing.T) {
7878
assert.Equal(t, lwcomponent.UpdateAvailable, component.Status)
7979
})
8080

81-
t.Run("Installed Deprecated No API", func(t *testing.T) {
81+
t.Run("Installed No API", func(t *testing.T) {
8282
var (
83-
name string = "installed-deprecated-no-api"
83+
name string = "installed-no-api"
8484
ver string = "1.1.1"
8585
)
8686

@@ -92,7 +92,7 @@ func TestNewCDKComponent(t *testing.T) {
9292

9393
component := lwcomponent.NewCDKComponent(nil, hostInfo)
9494

95-
assert.Equal(t, lwcomponent.InstalledDeprecated, component.Status)
95+
assert.Equal(t, lwcomponent.Installed, component.Status)
9696
})
9797

9898
t.Run("Installed Deprecated API", func(t *testing.T) {

0 commit comments

Comments
 (0)