-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Deletion Modes): Populate associated resources field in Manifest #1675
feat(Deletion Modes): Populate associated resources field in Manifest #1675
Conversation
…ate_managedResources_manifest # Conflicts: # api/v1beta2/manifest_types.go # api/v1beta2/zz_generated.deepcopy.go # docs/technical-reference/api/manifest-cr.md
77cf6d9
to
7eeab44
Compare
5608512
to
e1fb17f
Compare
…om/nesmabadr/lifecycle-manager into populate_managedResources_manifest
d006b2b
to
3fe52f6
Compare
99a0ecd
to
30aea5f
Compare
30aea5f
to
2da5507
Compare
6f858df
to
dc59105
Compare
dc59105
to
aef4158
Compare
21e7ce2
to
9e1f073
Compare
…fest # Conflicts: # internal/manifest/spec_resolver.go # tests/integration/controller/kyma/manifest_test.go
9e1f073
to
e8f6fdd
Compare
|
||
"github.com/kyma-project/lifecycle-manager/api/v1beta2" | ||
"github.com/kyma-project/lifecycle-manager/internal/manifest/filemutex" | ||
"github.com/kyma-project/lifecycle-manager/pkg/ocmextensions" | ||
"github.com/kyma-project/lifecycle-manager/pkg/img" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to internal
instead of pkg
? Maybe difficult due to usages in template_to_module which should also be moved
@@ -9,13 +9,31 @@ import ( | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package can also go to internal
CRDsLayer LayerName = "crds" | ||
ConfigLayer LayerName = "config" | ||
CRDsLayer LayerName = "crds" | ||
AssociatedResourcesLayer LayerName = "associated-resources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these consts are not used within this package
@@ -47,3 +58,24 @@ type ( | |||
) | |||
|
|||
type Layers []Layer | |||
|
|||
func PullLayer(ctx context.Context, imageRef string, keyChain authn.Keychain) (containerregistryv1.Layer, error) { | |||
noSchemeImageRef := ocmextensions.NoSchemeURL(imageRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be moved down closer to actual usage
@@ -81,7 +92,7 @@ func (p *Parser) GenerateMandatoryModulesFromTemplates(ctx context.Context, | |||
return modules | |||
} | |||
|
|||
func (p *Parser) appendModuleWithInformation(module v1beta2.AvailableModule, kyma *v1beta2.Kyma, | |||
func (p *Parser) appendModuleWithInformation(ctx context.Context, module v1beta2.AvailableModule, kyma *v1beta2.Kyma, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's refactor this part a bit!
The reason to pass modules list as arg here is to append to it. Appending can be done by consumer, let's change the result of this function to return only the module. and split responsibilities. Then this func also needs a new name.
Also we may try to move all the logic from p.newManifestFromTemplate()
into a separate dependency, let's say a ManifestCreator
that may be tested separately.
func (p *Parser) fetchAssociatedResourcesField(ctx context.Context, layer *img.OCI, version string) ([]string, | ||
error, | ||
) { | ||
associatedResourcesLayer := v1beta2.ImageSpec{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating this seems a bit redundant since the only value used for a dependency is layer.CredSecretSelector
for the LookupKeyChain()
a49921e
to
8d83d22
Compare
Description
Changes proposed in this pull request:
Related issue(s)
Resolves #1651