@@ -16,6 +16,7 @@ import (
1616 "k8s.io/apimachinery/pkg/runtime"
1717 "k8s.io/apimachinery/pkg/runtime/schema"
1818
19+ "github.com/operator-framework/operator-controller/internal/operator-controller/applier"
1920 "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/preflights/crdupgradesafety"
2021 "github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/util"
2122)
@@ -194,7 +195,10 @@ func TestInstall(t *testing.T) {
194195 for _ , tc := range tests {
195196 t .Run (tc .name , func (t * testing.T ) {
196197 preflight := newMockPreflight (getCrdFromManifestFile (t , tc .oldCrdPath ), tc .wantCrdGetErr )
197- err := preflight .Install (context .Background (), tc .release )
198+ objs , err := applier.HelmReleaseToObjectsConverter {}.GetObjectsFromRelease (tc .release )
199+ if err == nil {
200+ err = preflight .Install (context .Background (), objs )
201+ }
198202 if tc .requireErr != nil {
199203 tc .requireErr (t , err )
200204 } else {
@@ -370,7 +374,10 @@ func TestUpgrade(t *testing.T) {
370374 for _ , tc := range tests {
371375 t .Run (tc .name , func (t * testing.T ) {
372376 preflight := newMockPreflight (getCrdFromManifestFile (t , tc .oldCrdPath ), tc .wantCrdGetErr )
373- err := preflight .Upgrade (context .Background (), tc .release )
377+ objs , err := applier.HelmReleaseToObjectsConverter {}.GetObjectsFromRelease (tc .release )
378+ if err == nil {
379+ err = preflight .Upgrade (context .Background (), objs )
380+ }
374381 if tc .requireErr != nil {
375382 tc .requireErr (t , err )
376383 } else {
0 commit comments