Skip to content

feat: support external dependencies for deploy-dependency and delete-dependency annotations#617

Merged
dmmordvi merged 9 commits into
2from
feat/external-deploy-delete-deps
May 18, 2026
Merged

feat: support external dependencies for deploy-dependency and delete-dependency annotations#617
dmmordvi merged 9 commits into
2from
feat/external-deploy-delete-deps

Conversation

@dmmordvi
Copy link
Copy Markdown
Contributor

No description provided.

dmmordvi added 2 commits May 12, 2026 21:57
…dependency annotations

Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
@dmmordvi dmmordvi requested a review from ilya-lesikov May 12, 2026 19:23
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Comment thread pkg/resource/dependency.go Outdated
type Dependency struct {
*spec.ResourceMatcher `json:"resourceMatcher"`

ResourceMeta *spec.ResourceMeta `json:"resourceMeta"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have both ResourceMatcher and ResourceMeta, bad/unclear design

Comment thread pkg/resource/metadata.go Outdated

if dep.External {
dep.MinMatches = 1
dep.MaxMatches = 30
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these as constants to common pkg

Comment thread pkg/resource/metadata.go Outdated

if dep.External {
dep.MinMatches = 1
dep.MaxMatches = 30
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to constants

Comment thread pkg/resource/metadata.go Outdated
switch pv := propVal.(type) {
case string:
switch pv {
case "auto", "true", "false":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to constants to common pkg, and use them everywhere in this PR

Comment thread pkg/resource/resource.go Outdated
}

// Catches validation error for External delete dependencies
if _, err := manualDeleteDependencies(res.ResourceMeta, otherResourceMetaList, releaseNamespace); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do separately validateDeploy(Delete)Dependencies, can't we write manualDeploy(Delete)Dependencies in a way that they rely on the previous call of validate... functions? So that inside manualDeploy(Delete)Dependencies we often won't check errors (panic instead), etc, so no error will be returned at all? Look at how we do other functions like this where validate is separate

dmmordvi added 2 commits May 13, 2026 20:27
…ons, apply review suggestions

Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>

# Conflicts:
#	pkg/action/release_uninstall.go
@dmmordvi dmmordvi requested a review from ilya-lesikov May 13, 2026 17:30
dmmordvi added 2 commits May 17, 2026 20:04
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>

# Conflicts:
#	pkg/resource/resource.go
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Comment thread pkg/common/common.go Outdated
Comment on lines +113 to +115
DependencyExternalAuto = "auto"
DependencyExternalFalse = "false"
DependencyExternalTrue = "true"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a type DependencyExternal string for those

Comment thread pkg/resource/resource.go Outdated
var manDeps []*Dependency
if err := validateDeleteDependencies(resourceSpec.ResourceMeta); err == nil {
manDeps, _ = manualDeleteDependencies(resourceSpec.ResourceMeta, otherResourceMetaList, releaseNamespace)
if err := validateDeleteDependencies(resourceSpec.ResourceMeta, otherResourceMetaList); err == nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? We should fail here if err != nil

dmmordvi added 2 commits May 18, 2026 14:44
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>

# Conflicts:
#	pkg/common/common.go
#	pkg/resource/resource_test.go
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
@dmmordvi dmmordvi merged commit 581acf9 into 2 May 18, 2026
12 of 13 checks passed
@dmmordvi dmmordvi deleted the feat/external-deploy-delete-deps branch May 18, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants