-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
types.go
1544 lines (1367 loc) · 61.9 KB
/
types.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package v1alpha1
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"gopkg.in/yaml.v2"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"
"github.com/argoproj/argo-cd/common"
"github.com/argoproj/argo-cd/util/git"
"github.com/argoproj/argo-cd/util/rbac"
)
// Application is a definition of Application resource.
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:path=applications,shortName=app;apps
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
Spec ApplicationSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
Status ApplicationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
Operation *Operation `json:"operation,omitempty" protobuf:"bytes,4,opt,name=operation"`
}
// ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision.
type ApplicationSpec struct {
// Source is a reference to the location ksonnet application definition
Source ApplicationSource `json:"source" protobuf:"bytes,1,opt,name=source"`
// Destination overrides the kubernetes server and namespace defined in the environment ksonnet app.yaml
Destination ApplicationDestination `json:"destination" protobuf:"bytes,2,name=destination"`
// Project is a application project name. Empty name means that application belongs to 'default' project.
Project string `json:"project" protobuf:"bytes,3,name=project"`
// SyncPolicy controls when a sync will be performed
SyncPolicy *SyncPolicy `json:"syncPolicy,omitempty" protobuf:"bytes,4,name=syncPolicy"`
// IgnoreDifferences controls resources fields which should be ignored during comparison
IgnoreDifferences []ResourceIgnoreDifferences `json:"ignoreDifferences,omitempty" protobuf:"bytes,5,name=ignoreDifferences"`
// Infos contains a list of useful information (URLs, email addresses, and plain text) that relates to the application
Info []Info `json:"info,omitempty" protobuf:"bytes,6,name=info"`
}
// ResourceIgnoreDifferences contains resource filter and list of json paths which should be ignored during comparison with live state.
type ResourceIgnoreDifferences struct {
Group string `json:"group" protobuf:"bytes,1,opt,name=group"`
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
JSONPointers []string `json:"jsonPointers" protobuf:"bytes,5,opt,name=jsonPointers"`
}
type EnvEntry struct {
// the name, usually uppercase
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
// the value
Value string `json:"value" protobuf:"bytes,2,opt,name=value"`
}
func (a *EnvEntry) IsZero() bool {
return a == nil || a.Name == "" && a.Value == ""
}
type Env []*EnvEntry
func (e Env) IsZero() bool {
return len(e) == 0
}
func (e Env) Environ() []string {
var environ []string
for _, item := range e {
if !item.IsZero() {
environ = append(environ, fmt.Sprintf("%s=%s", item.Name, item.Value))
}
}
return environ
}
// ApplicationSource contains information about github repository, path within repository and target application environment.
type ApplicationSource struct {
// RepoURL is the git repository URL of the application manifests
RepoURL string `json:"repoURL" protobuf:"bytes,1,opt,name=repoURL"`
// Path is a directory path within the repository containing a
Path string `json:"path" protobuf:"bytes,2,opt,name=path"`
// TargetRevision defines the commit, tag, or branch in which to sync the application to.
// If omitted, will sync to HEAD
TargetRevision string `json:"targetRevision,omitempty" protobuf:"bytes,4,opt,name=targetRevision"`
// Helm holds helm specific options
Helm *ApplicationSourceHelm `json:"helm,omitempty" protobuf:"bytes,7,opt,name=helm"`
// Kustomize holds kustomize specific options
Kustomize *ApplicationSourceKustomize `json:"kustomize,omitempty" protobuf:"bytes,8,opt,name=kustomize"`
// Ksonnet holds ksonnet specific options
Ksonnet *ApplicationSourceKsonnet `json:"ksonnet,omitempty" protobuf:"bytes,9,opt,name=ksonnet"`
// Directory holds path/directory specific options
Directory *ApplicationSourceDirectory `json:"directory,omitempty" protobuf:"bytes,10,opt,name=directory"`
// ConfigManagementPlugin holds config management plugin specific options
Plugin *ApplicationSourcePlugin `json:"plugin,omitempty" protobuf:"bytes,11,opt,name=plugin"`
}
func (a *ApplicationSource) IsZero() bool {
return a == nil ||
a.RepoURL == "" &&
a.Path == "" &&
a.TargetRevision == "" &&
a.Helm.IsZero() &&
a.Kustomize.IsZero() &&
a.Ksonnet.IsZero() &&
a.Directory.IsZero() &&
a.Plugin.IsZero()
}
type ApplicationSourceType string
const (
ApplicationSourceTypeHelm ApplicationSourceType = "Helm"
ApplicationSourceTypeKustomize ApplicationSourceType = "Kustomize"
ApplicationSourceTypeKsonnet ApplicationSourceType = "Ksonnet"
ApplicationSourceTypeDirectory ApplicationSourceType = "Directory"
ApplicationSourceTypePlugin ApplicationSourceType = "Plugin"
)
type RefreshType string
const (
RefreshTypeNormal RefreshType = "normal"
RefreshTypeHard RefreshType = "hard"
)
// ApplicationSourceHelm holds helm specific options
type ApplicationSourceHelm struct {
// ValuesFiles is a list of Helm value files to use when generating a template
ValueFiles []string `json:"valueFiles,omitempty" protobuf:"bytes,1,opt,name=valueFiles"`
// Parameters are parameters to the helm template
Parameters []HelmParameter `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
// The Helm release name. If omitted it will use the application name
ReleaseName string `json:"releaseName,omitempty" protobuf:"bytes,3,opt,name=releaseName"`
}
// HelmParameter is a parameter to a helm template
type HelmParameter struct {
// Name is the name of the helm parameter
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// Value is the value for the helm parameter
Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
// ForceString determines whether to tell Helm to interpret booleans and numbers as strings
ForceString bool `json:"forceString,omitempty" protobuf:"bytes,3,opt,name=forceString"`
}
func (h *ApplicationSourceHelm) IsZero() bool {
return h == nil || (h.ReleaseName == "") && len(h.ValueFiles) == 0 && len(h.Parameters) == 0
}
type KustomizeImage string
func (i KustomizeImage) delim() string {
for _, d := range []string{"=", ":", "@"} {
if strings.Contains(string(i), d) {
return d
}
}
return ":"
}
// if the image name matches (i.e. up to the first delimiter)
func (i KustomizeImage) Match(j KustomizeImage) bool {
delim := j.delim()
if !strings.Contains(string(j), delim) {
return false
}
return strings.HasPrefix(string(i), strings.Split(string(j), delim)[0])
}
type KustomizeImages []KustomizeImage
// find the image or -1
func (images KustomizeImages) Find(image KustomizeImage) int {
for i, a := range images {
if a.Match(image) {
return i
}
}
return -1
}
// ApplicationSourceKustomize holds kustomize specific options
type ApplicationSourceKustomize struct {
// NamePrefix is a prefix appended to resources for kustomize apps
NamePrefix string `json:"namePrefix,omitempty" protobuf:"bytes,1,opt,name=namePrefix"`
// Images are kustomize image overrides
Images KustomizeImages `json:"images,omitempty" protobuf:"bytes,3,opt,name=images"`
// CommonLabels adds additional kustomize commonLabels
CommonLabels map[string]string `json:"commonLabels,omitempty" protobuf:"bytes,4,opt,name=commonLabels"`
}
func (k *ApplicationSourceKustomize) IsZero() bool {
return k == nil || k.NamePrefix == "" && len(k.Images) == 0 && len(k.CommonLabels) == 0
}
// either updates or adds the images
func (k *ApplicationSourceKustomize) MergeImage(image KustomizeImage) {
i := k.Images.Find(image)
if i >= 0 {
k.Images[i] = image
} else {
k.Images = append(k.Images, image)
}
}
// JsonnetVar is a jsonnet variable
type JsonnetVar struct {
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
Value string `json:"value" protobuf:"bytes,2,opt,name=value"`
Code bool `json:"code,omitempty" protobuf:"bytes,3,opt,name=code"`
}
// ApplicationSourceJsonnet holds jsonnet specific options
type ApplicationSourceJsonnet struct {
// ExtVars is a list of Jsonnet External Variables
ExtVars []JsonnetVar `json:"extVars,omitempty" protobuf:"bytes,1,opt,name=extVars"`
// TLAS is a list of Jsonnet Top-level Arguments
TLAs []JsonnetVar `json:"tlas,omitempty" protobuf:"bytes,2,opt,name=tlas"`
}
func (j *ApplicationSourceJsonnet) IsZero() bool {
return j == nil || len(j.ExtVars) == 0 && len(j.TLAs) == 0
}
// ApplicationSourceKsonnet holds ksonnet specific options
type ApplicationSourceKsonnet struct {
// Environment is a ksonnet application environment name
Environment string `json:"environment,omitempty" protobuf:"bytes,1,opt,name=environment"`
// Parameters are a list of ksonnet component parameter override values
Parameters []KsonnetParameter `json:"parameters,omitempty" protobuf:"bytes,2,opt,name=parameters"`
}
// KsonnetParameter is a ksonnet component parameter
type KsonnetParameter struct {
Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"`
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
Value string `json:"value" protobuf:"bytes,3,opt,name=value"`
}
func (k *ApplicationSourceKsonnet) IsZero() bool {
return k == nil || k.Environment == "" && len(k.Parameters) == 0
}
type ApplicationSourceDirectory struct {
Recurse bool `json:"recurse,omitempty" protobuf:"bytes,1,opt,name=recurse"`
Jsonnet ApplicationSourceJsonnet `json:"jsonnet,omitempty" protobuf:"bytes,2,opt,name=jsonnet"`
}
func (d *ApplicationSourceDirectory) IsZero() bool {
return d == nil || !d.Recurse && d.Jsonnet.IsZero()
}
// ApplicationSourcePlugin holds config management plugin specific options
type ApplicationSourcePlugin struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Env `json:"env,omitempty" protobuf:"bytes,2,opt,name=env"`
}
func (c *ApplicationSourcePlugin) IsZero() bool {
return c == nil || c.Name == "" && c.Env.IsZero()
}
// ApplicationDestination contains deployment destination information
type ApplicationDestination struct {
// Server overrides the environment server value in the ksonnet app.yaml
Server string `json:"server,omitempty" protobuf:"bytes,1,opt,name=server"`
// Namespace overrides the environment namespace value in the ksonnet app.yaml
Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
}
// ApplicationStatus contains information about application sync, health status
type ApplicationStatus struct {
Resources []ResourceStatus `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"`
Sync SyncStatus `json:"sync,omitempty" protobuf:"bytes,2,opt,name=sync"`
Health HealthStatus `json:"health,omitempty" protobuf:"bytes,3,opt,name=health"`
History []RevisionHistory `json:"history,omitempty" protobuf:"bytes,4,opt,name=history"`
Conditions []ApplicationCondition `json:"conditions,omitempty" protobuf:"bytes,5,opt,name=conditions"`
ReconciledAt *metav1.Time `json:"reconciledAt,omitempty" protobuf:"bytes,6,opt,name=reconciledAt"`
OperationState *OperationState `json:"operationState,omitempty" protobuf:"bytes,7,opt,name=operationState"`
ObservedAt *metav1.Time `json:"observedAt,omitempty" protobuf:"bytes,8,opt,name=observedAt"`
SourceType ApplicationSourceType `json:"sourceType,omitempty" protobuf:"bytes,9,opt,name=sourceType"`
Summary ApplicationSummary `json:"summary,omitempty" protobuf:"bytes,10,opt,name=summary"`
}
// Operation contains requested operation parameters.
type Operation struct {
Sync *SyncOperation `json:"sync,omitempty" protobuf:"bytes,1,opt,name=sync"`
}
// SyncOperationResource contains resources to sync.
type SyncOperationResource struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
}
// HasIdentity determines whether a sync operation is identified by a manifest.
func (r SyncOperationResource) HasIdentity(name string, gvk schema.GroupVersionKind) bool {
if name == r.Name && gvk.Kind == r.Kind && gvk.Group == r.Group {
return true
}
return false
}
// SyncOperation contains sync operation details.
type SyncOperation struct {
// Revision is the git revision in which to sync the application to.
// If omitted, will use the revision specified in app spec.
Revision string `json:"revision,omitempty" protobuf:"bytes,1,opt,name=revision"`
// Prune deletes resources that are no longer tracked in git
Prune bool `json:"prune,omitempty" protobuf:"bytes,2,opt,name=prune"`
// DryRun will perform a `kubectl apply --dry-run` without actually performing the sync
DryRun bool `json:"dryRun,omitempty" protobuf:"bytes,3,opt,name=dryRun"`
// SyncStrategy describes how to perform the sync
SyncStrategy *SyncStrategy `json:"syncStrategy,omitempty" protobuf:"bytes,4,opt,name=syncStrategy"`
// Resources describes which resources to sync
Resources []SyncOperationResource `json:"resources,omitempty" protobuf:"bytes,6,opt,name=resources"`
// Source overrides the source definition set in the application.
// This is typically set in a Rollback operation and nil during a Sync operation
Source *ApplicationSource `json:"source,omitempty" protobuf:"bytes,7,opt,name=source"`
// Manifests is an optional field that overrides sync source with a local directory for development
Manifests []string `json:"manifests,omitempty" protobuf:"bytes,8,opt,name=manifests"`
}
func (o *SyncOperation) IsApplyStrategy() bool {
return o.SyncStrategy != nil && o.SyncStrategy.Apply != nil
}
type OperationPhase string
const (
OperationRunning OperationPhase = "Running"
OperationTerminating OperationPhase = "Terminating"
OperationFailed OperationPhase = "Failed"
OperationError OperationPhase = "Error"
OperationSucceeded OperationPhase = "Succeeded"
)
func (os OperationPhase) Completed() bool {
switch os {
case OperationFailed, OperationError, OperationSucceeded:
return true
}
return false
}
func (os OperationPhase) Successful() bool {
return os == OperationSucceeded
}
// OperationState contains information about state of currently performing operation on application.
type OperationState struct {
// Operation is the original requested operation
Operation Operation `json:"operation" protobuf:"bytes,1,opt,name=operation"`
// Phase is the current phase of the operation
Phase OperationPhase `json:"phase" protobuf:"bytes,2,opt,name=phase"`
// Message hold any pertinent messages when attempting to perform operation (typically errors).
Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
// SyncResult is the result of a Sync operation
SyncResult *SyncOperationResult `json:"syncResult,omitempty" protobuf:"bytes,4,opt,name=syncResult"`
// StartedAt contains time of operation start
StartedAt metav1.Time `json:"startedAt" protobuf:"bytes,6,opt,name=startedAt"`
// FinishedAt contains time of operation completion
FinishedAt *metav1.Time `json:"finishedAt,omitempty" protobuf:"bytes,7,opt,name=finishedAt"`
}
type Info struct {
Name string `json:"name" protobuf:"bytes,1,name=name"`
Value string `json:"value" protobuf:"bytes,2,name=value"`
}
// SyncPolicy controls when a sync will be performed in response to updates in git
type SyncPolicy struct {
// Automated will keep an application synced to the target revision
Automated *SyncPolicyAutomated `json:"automated,omitempty" protobuf:"bytes,1,opt,name=automated"`
}
// SyncPolicyAutomated controls the behavior of an automated sync
type SyncPolicyAutomated struct {
// Prune will prune resources automatically as part of automated sync (default: false)
Prune bool `json:"prune,omitempty" protobuf:"bytes,1,opt,name=prune"`
// SelfHeal enables auto-syncing if (default: false)
SelfHeal bool `json:"selfHeal,omitempty" protobuf:"bytes,2,opt,name=selfHeal"`
}
// SyncStrategy controls the manner in which a sync is performed
type SyncStrategy struct {
// Apply wil perform a `kubectl apply` to perform the sync.
Apply *SyncStrategyApply `json:"apply,omitempty" protobuf:"bytes,1,opt,name=apply"`
// Hook will submit any referenced resources to perform the sync. This is the default strategy
Hook *SyncStrategyHook `json:"hook,omitempty" protobuf:"bytes,2,opt,name=hook"`
}
func (m *SyncStrategy) Force() bool {
if m == nil {
return false
} else if m.Apply != nil {
return m.Apply.Force
} else if m.Hook != nil {
return m.Hook.Force
} else {
return false
}
}
// SyncStrategyApply uses `kubectl apply` to perform the apply
type SyncStrategyApply struct {
// Force indicates whether or not to supply the --force flag to `kubectl apply`.
// The --force flag deletes and re-create the resource, when PATCH encounters conflict and has
// retried for 5 times.
Force bool `json:"force,omitempty" protobuf:"bytes,1,opt,name=force"`
}
// SyncStrategyHook will perform a sync using hooks annotations.
// If no hook annotation is specified falls back to `kubectl apply`.
type SyncStrategyHook struct {
// Embed SyncStrategyApply type to inherit any `apply` options
// +optional
SyncStrategyApply `json:",inline" protobuf:"bytes,1,opt,name=syncStrategyApply"`
}
type HookType string
const (
HookTypePreSync HookType = "PreSync"
HookTypeSync HookType = "Sync"
HookTypePostSync HookType = "PostSync"
HookTypeSkip HookType = "Skip"
HookTypeSyncFail HookType = "SyncFail"
// NOTE: we may consider adding SyncFail hook. With a SyncFail hook, finalizer-like logic could
// be implemented by specifying both PostSync,SyncFail in the hook annotation:
// (e.g.: argocd.argoproj.io/hook: PostSync,SyncFail)
//HookTypeSyncFail HookType = "SyncFail"
)
type HookDeletePolicy string
const (
HookDeletePolicyHookSucceeded HookDeletePolicy = "HookSucceeded"
HookDeletePolicyHookFailed HookDeletePolicy = "HookFailed"
)
// data about a specific revision within a repo
type RevisionMetadata struct {
// who authored this revision,
// typically their name and email, e.g. "John Doe <john_doe@my-company.com>",
// but might not match this example
Author string `json:"author" protobuf:"bytes,1,opt,name=author"`
// when the revision was authored
Date metav1.Time `json:"date" protobuf:"bytes,2,opt,name=date"`
// tags on the revision,
// note - tags can move from one revision to another
Tags []string `json:"tags" protobuf:"bytes,3,opt,name=tags"`
// the message associated with the revision,
// probably the commit message,
// this is truncated to the first newline or 64 characters (which ever comes first)
Message string `json:"message" protobuf:"bytes,4,opt,name=message"`
}
// SyncOperationResult represent result of sync operation
type SyncOperationResult struct {
// Resources holds the sync result of each individual resource
Resources ResourceResults `json:"resources,omitempty" protobuf:"bytes,1,opt,name=resources"`
// Revision holds the git commit SHA of the sync
Revision string `json:"revision" protobuf:"bytes,2,opt,name=revision"`
// Source records the application source information of the sync, used for comparing auto-sync
Source ApplicationSource `json:"source,omitempty" protobuf:"bytes,3,opt,name=source"`
}
type ResultCode string
const (
ResultCodeSynced ResultCode = "Synced"
ResultCodeSyncFailed ResultCode = "SyncFailed"
ResultCodePruned ResultCode = "Pruned"
ResultCodePruneSkipped ResultCode = "PruneSkipped"
)
type SyncPhase = string
const (
SyncPhasePreSync = "PreSync"
SyncPhaseSync = "Sync"
SyncPhasePostSync = "PostSync"
SyncPhaseSyncFail = "SyncFail"
)
// ResourceResult holds the operation result details of a specific resource
type ResourceResult struct {
Group string `json:"group" protobuf:"bytes,1,opt,name=group"`
Version string `json:"version" protobuf:"bytes,2,opt,name=version"`
Kind string `json:"kind" protobuf:"bytes,3,opt,name=kind"`
Namespace string `json:"namespace" protobuf:"bytes,4,opt,name=namespace"`
Name string `json:"name" protobuf:"bytes,5,opt,name=name"`
// the final result of the sync, this is be empty if the resources is yet to be applied/pruned and is always zero-value for hooks
Status ResultCode `json:"status,omitempty" protobuf:"bytes,6,opt,name=status"`
// message for the last sync OR operation
Message string `json:"message,omitempty" protobuf:"bytes,7,opt,name=message"`
// the type of the hook, empty for non-hook resources
HookType HookType `json:"hookType,omitempty" protobuf:"bytes,8,opt,name=hookType"`
// the state of any operation associated with this resource OR hook
// note: can contain values for non-hook resources
HookPhase OperationPhase `json:"hookPhase,omitempty" protobuf:"bytes,9,opt,name=hookPhase"`
// indicates the particular phase of the sync that this is for
SyncPhase SyncPhase `json:"syncPhase,omitempty" protobuf:"bytes,10,opt,name=syncPhase"`
}
func (r *ResourceResult) GroupVersionKind() schema.GroupVersionKind {
return schema.GroupVersionKind{
Group: r.Group,
Version: r.Version,
Kind: r.Kind,
}
}
type ResourceResults []*ResourceResult
func (r ResourceResults) Filter(predicate func(r *ResourceResult) bool) ResourceResults {
results := ResourceResults{}
for _, res := range r {
if predicate(res) {
results = append(results, res)
}
}
return results
}
func (r ResourceResults) Find(group string, kind string, namespace string, name string, phase SyncPhase) (int, *ResourceResult) {
for i, res := range r {
if res.Group == group && res.Kind == kind && res.Namespace == namespace && res.Name == name && res.SyncPhase == phase {
return i, res
}
}
return 0, nil
}
func (r ResourceResults) PruningRequired() (num int) {
for _, res := range r {
if res.Status == ResultCodePruneSkipped {
num++
}
}
return num
}
// RevisionHistory contains information relevant to an application deployment
type RevisionHistory struct {
Revision string `json:"revision" protobuf:"bytes,2,opt,name=revision"`
DeployedAt metav1.Time `json:"deployedAt" protobuf:"bytes,4,opt,name=deployedAt"`
ID int64 `json:"id" protobuf:"bytes,5,opt,name=id"`
Source ApplicationSource `json:"source,omitempty" protobuf:"bytes,6,opt,name=source"`
}
// ApplicationWatchEvent contains information about application change.
type ApplicationWatchEvent struct {
Type watch.EventType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=k8s.io/apimachinery/pkg/watch.EventType"`
// Application is:
// * If Type is Added or Modified: the new state of the object.
// * If Type is Deleted: the state of the object immediately before deletion.
// * If Type is Error: *api.Status is recommended; other types may make sense
// depending on context.
Application Application `json:"application" protobuf:"bytes,2,opt,name=application"`
}
// ApplicationList is list of Application resources
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
Items []Application `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// ComponentParameter contains information about component parameter value
type ComponentParameter struct {
Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"`
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
Value string `json:"value" protobuf:"bytes,3,opt,name=value"`
}
// SyncStatusCode is a type which represents possible comparison results
type SyncStatusCode string
// Possible comparison results
const (
SyncStatusCodeUnknown SyncStatusCode = "Unknown"
SyncStatusCodeSynced SyncStatusCode = "Synced"
SyncStatusCodeOutOfSync SyncStatusCode = "OutOfSync"
)
// ApplicationConditionType represents type of application condition. Type name has following convention:
// prefix "Error" means error condition
// prefix "Warning" means warning condition
// prefix "Info" means informational condition
type ApplicationConditionType = string
const (
// ApplicationConditionDeletionError indicates that controller failed to delete application
ApplicationConditionDeletionError = "DeletionError"
// ApplicationConditionInvalidSpecError indicates that application source is invalid
ApplicationConditionInvalidSpecError = "InvalidSpecError"
// ApplicationConditionComparisonError indicates controller failed to compare application state
ApplicationConditionComparisonError = "ComparisonError"
// ApplicationConditionSyncError indicates controller failed to automatically sync the application
ApplicationConditionSyncError = "SyncError"
// ApplicationConditionUnknownError indicates an unknown controller error
ApplicationConditionUnknownError = "UnknownError"
// ApplicationConditionSharedResourceWarning indicates that controller detected resources which belongs to more than one application
ApplicationConditionSharedResourceWarning = "SharedResourceWarning"
// ApplicationConditionRepeatedResourceWarning indicates that application source has resource with same Group, Kind, Name, Namespace multiple times
ApplicationConditionRepeatedResourceWarning = "RepeatedResourceWarning"
// ApplicationConditionExcludedResourceWarning indicates that application has resource which is configured to be excluded
ApplicationConditionExcludedResourceWarning = "ExcludedResourceWarning"
)
// ApplicationCondition contains details about current application condition
type ApplicationCondition struct {
// Type is an application condition type
Type ApplicationConditionType `json:"type" protobuf:"bytes,1,opt,name=type"`
// Message contains human-readable message indicating details about condition
Message string `json:"message" protobuf:"bytes,2,opt,name=message"`
}
// ComparedTo contains application source and target which was used for resources comparison
type ComparedTo struct {
Source ApplicationSource `json:"source" protobuf:"bytes,1,opt,name=source"`
Destination ApplicationDestination `json:"destination" protobuf:"bytes,2,opt,name=destination"`
}
// SyncStatus is a comparison result of application spec and deployed application.
type SyncStatus struct {
Status SyncStatusCode `json:"status" protobuf:"bytes,1,opt,name=status,casttype=SyncStatusCode"`
ComparedTo ComparedTo `json:"comparedTo,omitempty" protobuf:"bytes,2,opt,name=comparedTo"`
Revision string `json:"revision,omitempty" protobuf:"bytes,3,opt,name=revision"`
}
type HealthStatus struct {
Status HealthStatusCode `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"`
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
}
type HealthStatusCode = string
const (
HealthStatusUnknown HealthStatusCode = "Unknown"
HealthStatusProgressing HealthStatusCode = "Progressing"
HealthStatusHealthy HealthStatusCode = "Healthy"
HealthStatusSuspended HealthStatusCode = "Suspended"
HealthStatusDegraded HealthStatusCode = "Degraded"
HealthStatusMissing HealthStatusCode = "Missing"
)
// InfoItem contains human readable information about object
type InfoItem struct {
// Name is a human readable title for this piece of information.
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
// Value is human readable content.
Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
}
// ResourceNetworkingInfo holds networking resource related information
type ResourceNetworkingInfo struct {
TargetLabels map[string]string `json:"targetLabels,omitempty" protobuf:"bytes,1,opt,name=targetLabels"`
TargetRefs []ResourceRef `json:"targetRefs,omitempty" protobuf:"bytes,2,opt,name=targetRefs"`
Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,3,opt,name=labels"`
Ingress []v1.LoadBalancerIngress `json:"ingress,omitempty" protobuf:"bytes,4,opt,name=ingress"`
// ExternalURLs holds list of URLs which should be available externally. List is populated for ingress resources using rules hostnames.
ExternalURLs []string `json:"externalURLs,omitempty" protobuf:"bytes,5,opt,name=externalURLs"`
}
// ApplicationTree holds nodes which belongs to the application
type ApplicationTree struct {
Nodes []ResourceNode `json:"nodes,omitempty" protobuf:"bytes,1,rep,name=nodes"`
}
type ApplicationSummary struct {
// ExternalURLs holds all external URLs of application child resources.
ExternalURLs []string `json:"externalURLs,omitempty" protobuf:"bytes,1,opt,name=externalURLs"`
// Images holds all images of application child resources.
Images []string `json:"images,omitempty" protobuf:"bytes,2,opt,name=images"`
}
func (t *ApplicationTree) FindNode(group string, kind string, namespace string, name string) *ResourceNode {
for _, n := range t.Nodes {
if n.Group == group && n.Kind == kind && n.Namespace == namespace && n.Name == name {
return &n
}
}
return nil
}
func (t *ApplicationTree) GetSummary() ApplicationSummary {
urlsSet := make(map[string]bool)
imagesSet := make(map[string]bool)
for _, node := range t.Nodes {
if node.NetworkingInfo != nil {
for _, url := range node.NetworkingInfo.ExternalURLs {
urlsSet[url] = true
}
}
for _, image := range node.Images {
imagesSet[image] = true
}
}
urls := make([]string, 0)
for url := range urlsSet {
urls = append(urls, url)
}
images := make([]string, 0)
for image := range imagesSet {
images = append(images, image)
}
return ApplicationSummary{ExternalURLs: urls, Images: images}
}
// ResourceRef includes fields which unique identify resource
type ResourceRef struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
Name string `json:"name,omitempty" protobuf:"bytes,5,opt,name=name"`
UID string `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid"`
}
// ResourceNode contains information about live resource and its children
type ResourceNode struct {
ResourceRef `json:",inline" protobuf:"bytes,1,opt,name=resourceRef"`
ParentRefs []ResourceRef `json:"parentRefs,omitempty" protobuf:"bytes,2,opt,name=parentRefs"`
Info []InfoItem `json:"info,omitempty" protobuf:"bytes,3,opt,name=info"`
NetworkingInfo *ResourceNetworkingInfo `json:"networkingInfo,omitempty" protobuf:"bytes,4,opt,name=networkingInfo"`
ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,5,opt,name=resourceVersion"`
Images []string `json:"images,omitempty" protobuf:"bytes,6,opt,name=images"`
Health *HealthStatus `json:"health,omitempty" protobuf:"bytes,7,opt,name=health"`
}
func (n *ResourceNode) GroupKindVersion() schema.GroupVersionKind {
return schema.GroupVersionKind{
Group: n.Group,
Version: n.Version,
Kind: n.Kind,
}
}
// ResourceStatus holds the current sync and health status of a resource
type ResourceStatus struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,4,opt,name=namespace"`
Name string `json:"name,omitempty" protobuf:"bytes,5,opt,name=name"`
Status SyncStatusCode `json:"status,omitempty" protobuf:"bytes,6,opt,name=status"`
Health *HealthStatus `json:"health,omitempty" protobuf:"bytes,7,opt,name=health"`
Hook bool `json:"hook,omitempty" protobuf:"bytes,8,opt,name=hook"`
RequiresPruning bool `json:"requiresPruning,omitempty" protobuf:"bytes,9,opt,name=requiresPruning"`
}
func (r *ResourceStatus) GroupVersionKind() schema.GroupVersionKind {
return schema.GroupVersionKind{Group: r.Group, Version: r.Version, Kind: r.Kind}
}
// ResourceDiff holds the diff of a live and target resource object
type ResourceDiff struct {
Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"`
Kind string `json:"kind,omitempty" protobuf:"bytes,2,opt,name=kind"`
Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"`
Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"`
TargetState string `json:"targetState,omitempty" protobuf:"bytes,5,opt,name=targetState"`
LiveState string `json:"liveState,omitempty" protobuf:"bytes,6,opt,name=liveState"`
Diff string `json:"diff,omitempty" protobuf:"bytes,7,opt,name=diff"`
Hook bool `json:"hook,omitempty" protobuf:"bytes,8,opt,name=hook"`
}
// ConnectionStatus represents connection status
type ConnectionStatus = string
const (
ConnectionStatusSuccessful = "Successful"
ConnectionStatusFailed = "Failed"
)
// ConnectionState contains information about remote resource connection state
type ConnectionState struct {
Status ConnectionStatus `json:"status" protobuf:"bytes,1,opt,name=status"`
Message string `json:"message" protobuf:"bytes,2,opt,name=message"`
ModifiedAt *metav1.Time `json:"attemptedAt" protobuf:"bytes,3,opt,name=attemptedAt"`
}
// Cluster is the definition of a cluster resource
type Cluster struct {
// Server is the API server URL of the Kubernetes cluster
Server string `json:"server" protobuf:"bytes,1,opt,name=server"`
// Name of the cluster. If omitted, will use the server address
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
// Config holds cluster information for connecting to a cluster
Config ClusterConfig `json:"config" protobuf:"bytes,3,opt,name=config"`
// ConnectionState contains information about cluster connection state
ConnectionState ConnectionState `json:"connectionState,omitempty" protobuf:"bytes,4,opt,name=connectionState"`
}
// ClusterList is a collection of Clusters.
type ClusterList struct {
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// AWSAuthConfig is an AWS IAM authentication configuration
type AWSAuthConfig struct {
// ClusterName contains AWS cluster name
ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,1,opt,name=clusterName"`
// RoleARN contains optional role ARN. If set then AWS IAM Authenticator assume a role to perform cluster operations instead of the default AWS credential provider chain.
RoleARN string `json:"roleARN,omitempty" protobuf:"bytes,2,opt,name=roleARN"`
}
// ClusterConfig is the configuration attributes. This structure is subset of the go-client
// rest.Config with annotations added for marshalling.
type ClusterConfig struct {
// Server requires Basic authentication
Username string `json:"username,omitempty" protobuf:"bytes,1,opt,name=username"`
Password string `json:"password,omitempty" protobuf:"bytes,2,opt,name=password"`
// Server requires Bearer authentication. This client will not attempt to use
// refresh tokens for an OAuth2 flow.
// TODO: demonstrate an OAuth2 compatible client.
BearerToken string `json:"bearerToken,omitempty" protobuf:"bytes,3,opt,name=bearerToken"`
// TLSClientConfig contains settings to enable transport layer security
TLSClientConfig `json:"tlsClientConfig" protobuf:"bytes,4,opt,name=tlsClientConfig"`
// AWSAuthConfig contains IAM authentication configuration
AWSAuthConfig *AWSAuthConfig `json:"awsAuthConfig,omitempty" protobuf:"bytes,5,opt,name=awsAuthConfig"`
}
// TLSClientConfig contains settings to enable transport layer security
type TLSClientConfig struct {
// Server should be accessed without verifying the TLS certificate. For testing only.
Insecure bool `json:"insecure" protobuf:"bytes,1,opt,name=insecure"`
// ServerName is passed to the server for SNI and is used in the client to check server
// certificates against. If ServerName is empty, the hostname used to contact the
// server is used.
ServerName string `json:"serverName,omitempty" protobuf:"bytes,2,opt,name=serverName"`
// CertData holds PEM-encoded bytes (typically read from a client certificate file).
// CertData takes precedence over CertFile
CertData []byte `json:"certData,omitempty" protobuf:"bytes,3,opt,name=certData"`
// KeyData holds PEM-encoded bytes (typically read from a client certificate key file).
// KeyData takes precedence over KeyFile
KeyData []byte `json:"keyData,omitempty" protobuf:"bytes,4,opt,name=keyData"`
// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
// CAData takes precedence over CAFile
CAData []byte `json:"caData,omitempty" protobuf:"bytes,5,opt,name=caData"`
}
type HelmRepository struct {
URL string `json:"url" protobuf:"bytes,1,opt,name=url"`
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
CAData []byte `json:"caData,omitempty" protobuf:"bytes,3,opt,name=caData"`
CertData []byte `json:"certData,omitempty" protobuf:"bytes,4,opt,name=certData"`
KeyData []byte `json:"keyData,omitempty" protobuf:"bytes,5,opt,name=keyData"`
Username string `json:"username,omitempty" protobuf:"bytes,6,opt,name=username"`
Password string `json:"password,omitempty" protobuf:"bytes,7,opt,name=password"`
}
// ResourceOverride holds configuration to customize resource diffing and health assessment
type ResourceOverride struct {
HealthLua string `json:"health.lua,omitempty" protobuf:"bytes,1,opt,name=healthLua"`
Actions string `json:"actions,omitempty" protobuf:"bytes,3,opt,name=actions"`
IgnoreDifferences string `json:"ignoreDifferences,omitempty" protobuf:"bytes,2,opt,name=ignoreDifferences"`
}
func (o *ResourceOverride) GetActions() (ResourceActions, error) {
var actions ResourceActions
err := yaml.Unmarshal([]byte(o.Actions), &actions)
if err != nil {
return actions, err
}
return actions, nil
}
type ResourceActions struct {
ActionDiscoveryLua string `json:"discovery.lua,omitempty" yaml:"discovery.lua,omitempty" protobuf:"bytes,1,opt,name=actionDiscoveryLua"`
Definitions []ResourceActionDefinition `json:"definitions,omitEmpty" protobuf:"bytes,2,rep,name=definitions"`
}
type ResourceActionDefinition struct {
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
ActionLua string `json:"action.lua" yaml:"action.lua" protobuf:"bytes,2,opt,name=actionLua"`
}
type ResourceAction struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Params []ResourceActionParam `json:"params,omitempty" protobuf:"bytes,2,rep,name=params"`
}
type ResourceActionParam struct {
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"`
Default string `json:"default,omitempty" protobuf:"bytes,4,opt,name=default"`
}
// Repository is a Git repository holding application configurations
type Repository struct {
// URL of the repo
Repo string `json:"repo" protobuf:"bytes,1,opt,name=repo"`
// Username for authenticating at the repo server
Username string `json:"username,omitempty" protobuf:"bytes,2,opt,name=username"`
// Password for authenticating at the repo server
Password string `json:"password,omitempty" protobuf:"bytes,3,opt,name=password"`
// SSH private key data for authenticating at the repo server
SSHPrivateKey string `json:"sshPrivateKey,omitempty" protobuf:"bytes,4,opt,name=sshPrivateKey"`
// Current state of repository server connecting
ConnectionState ConnectionState `json:"connectionState,omitempty" protobuf:"bytes,5,opt,name=connectionState"`
// InsecureIgnoreHostKey should not be used anymore, Insecure is favoured
InsecureIgnoreHostKey bool `json:"insecureIgnoreHostKey,omitempty" protobuf:"bytes,6,opt,name=insecureIgnoreHostKey"`
// Whether the repo is insecure
Insecure bool `json:"insecure,omitempty" protobuf:"bytes,7,opt,name=insecure"`
// Whether git-lfs support should be enabled for this repo
EnableLFS bool `json:"enableLfs,omitempty" protobuf:"bytes,8,opt,name=enableLfs"`
// TLS client cert data for authenticating at the repo server
TLSClientCertData string `json:"tlsClientCertData,omitempty" protobuf:"bytes,9,opt,name=tlsClientCertData"`
// TLS client cert key for authenticating at the repo server
TLSClientCertKey string `json:"tlsClientCertKey,omitempty" protobuf:"bytes,10,opt,name=tlsClientCertKey"`
}
func (repo *Repository) IsInsecure() bool {
return repo.InsecureIgnoreHostKey || repo.Insecure
}
func (repo *Repository) IsLFSEnabled() bool {
return repo.EnableLFS
}
func (m *Repository) HasCredentials() bool {
return m.Username != "" || m.Password != "" || m.SSHPrivateKey != "" || m.InsecureIgnoreHostKey
}
func (m *Repository) CopyCredentialsFrom(source *Repository) {
if source != nil {
m.Username = source.Username
m.Password = source.Password
m.SSHPrivateKey = source.SSHPrivateKey
m.InsecureIgnoreHostKey = source.InsecureIgnoreHostKey
m.Insecure = source.Insecure
m.EnableLFS = source.EnableLFS
m.TLSClientCertData = source.TLSClientCertData
m.TLSClientCertKey = source.TLSClientCertKey
}
}
// RepositoryList is a collection of Repositories.
type RepositoryList struct {
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []Repository `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// A RepositoryCertificate is either SSH known hosts entry or TLS certificate
type RepositoryCertificate struct {
// Name of the server the certificate is intended for
ServerName string `json:"serverName" protobuf:"bytes,1,opt,name=serverName"`
// Type of certificate - currently "https" or "ssh"
CertType string `json:"certType" protobuf:"bytes,2,opt,name=certType"`
// The sub type of the cert, i.e. "ssh-rsa"
CertSubType string `json:"certSubType" protobuf:"bytes,3,opt,name=certSubType"`
// Actual certificate data, protocol dependent
CertData []byte `json:"certData" protobuf:"bytes,4,opt,name=certData"`
// Additional certificate info (e.g. SSH fingerprint, X509 CommonName)
CertInfo string `json:"certInfo" protobuf:"bytes,5,opt,name=certInfo"`
}
// RepositoryCertificateList is a collection of RepositoryCertificates
type RepositoryCertificateList struct {
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// List of certificates to be processed
Items []RepositoryCertificate `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// AppProjectList is list of AppProject resources
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppProjectList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`