-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathargocd.go
70 lines (60 loc) · 2.77 KB
/
argocd.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License
package course
// We may use these imports to track ArgoCD Applications exactly. However,
// this also pulls in kubernetes api packages, which makes reckoner rely
// on particular versions of kubernetes. At the time of writing, no such
// relationship exists. Once we've firmly chosen a path, this comment
// should be removed, and potentially this entire file.
// import (
// argoAppv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// )
type ArgoApplicationSpecSyncPolicyAutomated struct {
Prune bool `yaml:"prune,omitempty"`
}
type ArgoApplicationSpecSyncPolicy struct {
Automated ArgoApplicationSpecSyncPolicyAutomated `yaml:"automated,omitempty"`
Options []string `yaml:"syncOptions,omitempty"`
}
type ArgoApplicationSpecSourceDirectory struct {
Recurse bool `yaml:"recurse,omitempty"`
}
type ArgoApplicationSpecSource struct {
Directory ArgoApplicationSpecSourceDirectory `yaml:"directory,omitempty"`
Path string `yaml:"path"`
RepoURL string `yaml:"repoURL"`
}
type ArgoApplicationSpecDestination struct {
Server string `yaml:"server,omitempty"`
Namespace string `yaml:"namespace,omitempty"`
}
type ArgoApplicationSpec struct {
Source ArgoApplicationSpecSource `yaml:"source"`
Destination ArgoApplicationSpecDestination `yaml:"destination"`
Project string `yaml:"project"`
SyncPolicy ArgoApplicationSpecSyncPolicy `yaml:"syncPolicy,omitempty"`
}
// ArgoApplicationMetadata contains the k8s metadata for the gitops agent CustomResource.
// This is the resource/manifest/config the agent will read in, not the resources deployed by the agent.
type ArgoApplicationMetadata struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace,omitempty"`
Annotations map[string]string `yaml:"annotations,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
}
type ArgoApplication struct {
Kind string `yaml:"kind"`
APIVersion string `yaml:"apiVersion"`
Metadata ArgoApplicationMetadata `yaml:"metadata"`
Spec ArgoApplicationSpec `yaml:"spec"`
}