This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GetAppDetails function in templates/triggers (#155)
feat: GetAppDetails function in templates/triggers (#155)
- Loading branch information
Showing
9 changed files
with
205 additions
and
4 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,16 @@ | ||
package shared | ||
|
||
import "github.com/argoproj/argo-cd/reposerver/apiclient" | ||
|
||
type AppDetail struct { | ||
// AppDetail Type | ||
Type string | ||
// Ksonnet details | ||
Ksonnet *apiclient.KsonnetAppSpec | ||
// Helm details | ||
Helm *HelmAppSpec | ||
// Kustomize details | ||
Kustomize *apiclient.KustomizeAppSpec | ||
// Directory details | ||
Directory *apiclient.DirectoryAppSpec | ||
} |
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,35 @@ | ||
package shared | ||
|
||
import ( | ||
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" | ||
) | ||
|
||
type HelmAppSpec struct { | ||
Name string | ||
ValueFiles []string | ||
Parameters []*v1alpha1.HelmParameter | ||
Values string | ||
FileParameters []*v1alpha1.HelmFileParameter | ||
} | ||
|
||
func (has HelmAppSpec) GetParameterValueByName(Name string) string { | ||
var value string | ||
for i := range has.Parameters { | ||
if has.Parameters[i].Name == Name { | ||
value = has.Parameters[i].Value | ||
break | ||
} | ||
} | ||
return value | ||
} | ||
|
||
func (has HelmAppSpec) GetFileParameterPathByName(Name string) string { | ||
var path string | ||
for i := range has.FileParameters { | ||
if has.FileParameters[i].Name == Name { | ||
path = has.FileParameters[i].Path | ||
break | ||
} | ||
} | ||
return path | ||
} |
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,8 @@ | ||
package shared | ||
|
||
type HelmFileParameter struct { | ||
// Name is the name of the helm parameter | ||
Name string | ||
// Path is the path value for the helm parameter | ||
Path string | ||
} |
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,10 @@ | ||
package shared | ||
|
||
type HelmParameter struct { | ||
// Name is the name of the helm parameter | ||
Name string | ||
// Value is the value for the helm parameter | ||
Value string | ||
// ForceString determines whether to tell Helm to interpret booleans and numbers as strings | ||
ForceString bool | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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