-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Description
With #2634 and #2597 finished, KLM is able to construct ocm remote address without depending on ModuleTemplate, and fetch component descriptor remotely.
Going forward, we will get:
- OCI registry host from
- either the flag introduced in: Read ocm registry from docker-registry secret or deployment arguments #2597 OR
- the existing secret configured via
oci-registry-credential-secret
flag
- the component name and version from ModuleReleaseMeta (after Introduce
ocmComponentName
field to ModuleReleaseMeta #2634 is implemented).spec.ocmComponentName
and.spec.channels[].version
- OR for mandatory modules:
.spec.ocmComponentName
and.spec.mandatory.version
DEV Note
- right now we are taking the descriptor directly from the template:
lifecycle-manager/internal/descriptor/provider/provider.go
Lines 30 to 67 in e7efceb
func (c *CachedDescriptorProvider) GetDescriptor(template *v1beta2.ModuleTemplate) (*types.Descriptor, error) { if template == nil { return nil, ErrTemplateNil } if template.Spec.Descriptor.Object != nil { desc, ok := template.Spec.Descriptor.Object.(*types.Descriptor) if !ok { return nil, ErrTypeAssert } if desc == nil { return nil, ErrDescriptorNil } return desc, nil } key := cache.GenerateDescriptorKey(template) descriptor := c.DescriptorCache.Get(key) if descriptor != nil { return descriptor, nil } ocmDesc, err := compdesc.Decode( template.Spec.Descriptor.Raw, []compdesc.DecodeOption{compdesc.DisableValidation(true)}..., ) if err != nil { return nil, errors.Join(ErrDecode, err) } template.Spec.Descriptor.Object = &types.Descriptor{ComponentDescriptor: ocmDesc} descriptor, ok := template.Spec.Descriptor.Object.(*types.Descriptor) if !ok { return nil, ErrTypeAssert } return descriptor, nil } - this needs to be refactored to look it up from the registry with the information described above
GetDescriptor
is used by regular Kyma reconciler + mandatory installation and deletion reconcilers already- the signature will need to be changed as it currently accepts a ModuleTemplate
Reasons
unblock deprecating component descriptor from ModuleTemplate.
Acceptance Criteria
- Refactor
CachedDescriptorProvider
, make sure it fetches and caches component descriptor from remote oci registry instead of from ModuleTemplate.
Feature Testing
No response
Testing approach
No response
Attachments
No response
Metadata
Metadata
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.