This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package generators | ||
|
||
import ( | ||
"fmt" | ||
argoprojiov1alpha1 "github.com/argoproj-labs/applicationset/api/v1alpha1" | ||
argov1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" | ||
) | ||
|
||
var _ Generator = (*ClusterGenerator)(nil) | ||
|
||
// ClusterGenerator generates Applications for some or all clusters registered with ArgoCD. | ||
type ClusterGenerator struct { | ||
} | ||
|
||
func NewClusterGenerator() Generator { | ||
// TODO: pass client or informer for access to cluster secrets | ||
g := &ClusterGenerator{} | ||
return g | ||
} | ||
|
||
func (g *ClusterGenerator) GenerateApplications(appSet *argoprojiov1alpha1.ApplicationSet) ([]argov1alpha1.Application, error) { | ||
if appSet == nil { | ||
return nil, fmt.Errorf("ApplicationSet is empty") | ||
} | ||
|
||
return nil, nil | ||
} |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
package generators | ||
|
||
import ( | ||
argoprojiov1alpha1 "github.com/argoproj-labs/applicationset/api/v1alpha1" | ||
argov1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" | ||
) | ||
|
||
// Generator defines the interface implemented by all ApplicationSet generators. | ||
type Generator interface { | ||
// GenerateApplications interprets the ApplicationSet and generates all relevant Applications. | ||
// The expected / desired list of Applications is returned, it then needs to be reconciled | ||
// against the current state of the Applications in the cluster. | ||
GenerateApplications(appSet *argoprojiov1alpha1.ApplicationSet) ([]argov1alpha1.Application, error) | ||
} |
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 generators | ||
|
||
import ( | ||
"fmt" | ||
argoprojiov1alpha1 "github.com/argoproj-labs/applicationset/api/v1alpha1" | ||
argov1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" | ||
) | ||
|
||
var _ Generator = (*ListGenerator)(nil) | ||
|
||
type ListGenerator struct { | ||
} | ||
|
||
func NewListGenerator() Generator { | ||
g := &ListGenerator{} | ||
return g | ||
} | ||
|
||
func (g *ListGenerator) GenerateApplications(appSet *argoprojiov1alpha1.ApplicationSet) ([]argov1alpha1.Application, error) { | ||
if appSet == nil { | ||
return nil, fmt.Errorf("ApplicationSet is empty") | ||
} | ||
|
||
return nil, nil | ||
} |