-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
appdetail.go
53 lines (46 loc) · 1011 Bytes
/
appdetail.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package shared
import (
"time"
"github.com/argoproj/argo-cd/v2/reposerver/apiclient"
)
type CommitMetadata struct {
// Commit message
Message string
// Commit author
Author string
// Commit creation date
Date time.Time
// Associated tags
Tags []string
}
type AppDetail struct {
// AppDetail Type
Type string
// Helm details
Helm *CustomHelmAppSpec
// Kustomize details
Kustomize *apiclient.KustomizeAppSpec
// Directory details
Directory *apiclient.DirectoryAppSpec
}
type CustomHelmAppSpec apiclient.HelmAppSpec
func (has CustomHelmAppSpec) 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 CustomHelmAppSpec) 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
}