Skip to content

Commit eee2cd6

Browse files
authored
Fix structs to match argocd YAML files (#1084)
* CLD-8505:add metrics-server to be managed by argocd * CLD-8505:Fix struct to match argocd yaml files
1 parent 6989af0 commit eee2cd6

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

internal/provisioner/utility/unmanaged.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ func (u *unmanaged) CreateOrUpgrade() error {
219219
if err := u.utiliyArgocdDeploy(u.Name()); err != nil {
220220
return err
221221
}
222+
case model.MetricsServerCanonicalName:
223+
if err := u.utiliyArgocdDeploy(u.Name()); err != nil {
224+
return err
225+
}
222226
default:
223227
u.logger.WithFields(log.Fields{
224228
"unmanaged-action": "skip",

internal/tools/argocd/argocd.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ type ArgocdClusterLabels struct {
1313
}
1414

1515
type ArgocdClusterRegisterParameters struct {
16-
Name string `yaml:"name"`
17-
Type string `yaml:"type"`
18-
Labels ArgocdClusterLabels `yaml:"labels"`
19-
APIServer string `yaml:"api_server"`
20-
CertData string `yaml:"certData"`
21-
CaData string `yaml:"caData"`
22-
KeyData string `yaml:"keyData"`
16+
Name string `yaml:"name"`
17+
Type string `yaml:"type"`
18+
Labels ArgocdClusterLabels `yaml:"labels"`
19+
APIServer string `yaml:"api_server"`
20+
ArgoCDRoleARN string `yaml:"argoCDRoleARN,omitempty"`
21+
ClusterName string `yaml:"clusterName,omitempty"`
22+
CertData string `yaml:"certData,omitempty"`
23+
CaData string `yaml:"caData,omitempty"`
24+
KeyData string `yaml:"keyData,omitempty"`
2325
}
2426

2527
type Argock8sRegister struct {

internal/tools/argocd/argocd_apps.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ import (
77
)
88

99
type Application struct {
10-
Name string `yaml:"name"`
11-
Namespace string `yaml:"namespace"`
12-
Repo string `yaml:"repo"`
13-
Path string `yaml:"path"`
14-
Revision string `yaml:"revision"`
15-
Helm Helm `yaml:"helm"`
16-
ServerSideApply bool `yaml:"serverSideApply,omitempty"`
17-
Replace bool `yaml:"replace,omitempty"`
18-
ClusterLabels []Labels `yaml:"cluster_labels"`
10+
Name string `yaml:"name"`
11+
Namespace string `yaml:"namespace"`
12+
Repo string `yaml:"repo"`
13+
Path string `yaml:"path"`
14+
Revision string `yaml:"revision"`
15+
Helm Helm `yaml:"helm"`
16+
ServerSideApply bool `yaml:"serverSideApply,omitempty"`
17+
Replace bool `yaml:"replace,omitempty"`
18+
IgnoreDifferences []IgnoreDifference `yaml:"ignoreDifferences,omitempty"`
19+
ClusterLabels []Labels `yaml:"cluster_labels"`
1920
}
2021

2122
type Helm struct {
@@ -28,6 +29,13 @@ type Labels struct {
2829
ClusterID string `yaml:"cluster-id,omitempty"`
2930
}
3031

32+
type IgnoreDifference struct {
33+
Kind string `yaml:"kind"`
34+
Name string `yaml:"name"`
35+
Namespace string `yaml:"namespace"`
36+
JsonPointers []string `yaml:"jsonPointers"`
37+
}
38+
3139
// ReadArgoApplicationFile take a argocd application file and load it into Application struct
3240
func ReadArgoApplicationFile(appsFile []byte) (map[string][]Application, error) {
3341
var apps map[string][]Application

0 commit comments

Comments
 (0)