@@ -39,17 +39,27 @@ func NewPerNamespaceManifestLoader(repo Repository) *PerNamespaceManifestLoader
39
39
}
40
40
41
41
func (p * PerNamespaceManifestLoader ) ResolveManifest (ctx context.Context , o runtime.Object ) (map [string ]string , error ) {
42
- _ , ok := o .(* corev1beta1.ConfigConnectorContext )
42
+ ccc , ok := o .(* corev1beta1.ConfigConnectorContext )
43
43
if ! ok {
44
44
return nil , fmt .Errorf ("expected the resource to be a ConfigConnectorContext, but it was not. Object: %v" , o )
45
45
}
46
46
47
47
componentName := k8s .ConfigConnectorComponentName
48
48
channelName := k8s .StableChannel
49
- v , err := ResolveVersion (ctx , p .repo , componentName , channelName )
49
+
50
+ version := ccc .Spec .Version
51
+ if version == "" {
52
+ v , err := ResolveVersion (ctx , p .repo , componentName , channelName )
53
+ if err != nil {
54
+ return nil , fmt .Errorf ("error resolving the version for %v in %v channel: %w" , componentName , channelName , err )
55
+ }
56
+ version = v
57
+ }
58
+
59
+ files , err := p .repo .LoadNamespacedComponents (ctx , componentName , version )
50
60
if err != nil {
51
- return nil , fmt .Errorf ("error resolving the version for %v in %v channel : %w" , componentName , channelName , err )
61
+ return nil , fmt .Errorf ("version %q could not be loaded : %w" , version , err )
52
62
}
53
63
54
- return p . repo . LoadNamespacedComponents ( ctx , componentName , v )
64
+ return files , nil
55
65
}
0 commit comments