-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use Argo CD ApplicationSet to manage deployments across CDPipel…
…ine (#20) Added functionality: - For every CDPipeline ApplicationSet is created - If CDPipeline is removed, related ApplicationSet is removed too - For every Stage and Codebase in the CDPipeline - the related ApplicationSet generator is created/deleted Change-Id: I13bf5a98d84773dd026574246a72072ba8f853e9
- Loading branch information
Showing
17 changed files
with
2,208 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package chain | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
cdPipeApi "github.com/epam/edp-cd-pipeline-operator/v2/api/v1" | ||
) | ||
|
||
type applicationSetManager interface { | ||
CreateApplicationSetGenerators(ctx context.Context, stage *cdPipeApi.Stage) error | ||
RemoveApplicationSetGenerators(ctx context.Context, stage *cdPipeApi.Stage) error | ||
} | ||
|
||
type AddApplicationSetGenerators struct { | ||
applicationSetManager applicationSetManager | ||
} | ||
|
||
func (h AddApplicationSetGenerators) ServeRequest(ctx context.Context, stage *cdPipeApi.Stage) error { | ||
if err := h.applicationSetManager.CreateApplicationSetGenerators(ctx, stage); err != nil { | ||
return fmt.Errorf("failed to create application set generators: %w", err) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
controllers/stage/chain/remove_applicationset_generators.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package chain | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
cdPipeApi "github.com/epam/edp-cd-pipeline-operator/v2/api/v1" | ||
) | ||
|
||
type RemoveApplicationSetGenerators struct { | ||
applicationSetManager applicationSetManager | ||
} | ||
|
||
func (h RemoveApplicationSetGenerators) ServeRequest(ctx context.Context, stage *cdPipeApi.Stage) error { | ||
if err := h.applicationSetManager.RemoveApplicationSetGenerators(ctx, stage); err != nil { | ||
return fmt.Errorf("failed to remove application set generators: %w", err) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.