This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
/
api.go
89 lines (75 loc) · 2.15 KB
/
api.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
package v6
import (
"context"
"github.com/fluxcd/flux/cluster"
"github.com/fluxcd/flux/git"
"github.com/fluxcd/flux/job"
"github.com/fluxcd/flux/resource"
"github.com/fluxcd/flux/ssh"
"github.com/fluxcd/flux/update"
)
type ImageStatus struct {
ID resource.ID
Containers []Container
}
// ReadOnlyReason enumerates the reasons that a controller is
// considered read-only. The zero value is considered "OK", since the
// zero value is what prior versions of the daemon will effectively
// send.
type ReadOnlyReason string
const (
ReadOnlyOK ReadOnlyReason = ""
ReadOnlyMissing ReadOnlyReason = "NotInRepo"
ReadOnlySystem ReadOnlyReason = "System"
ReadOnlyNoRepo ReadOnlyReason = "NoRepo"
ReadOnlyNotReady ReadOnlyReason = "NotReady"
ReadOnlyROMode ReadOnlyReason = "ReadOnlyMode"
)
type ControllerStatus struct {
ID resource.ID
Containers []Container
ReadOnly ReadOnlyReason
Status string
Rollout cluster.RolloutStatus
SyncError string
Antecedent resource.ID
Labels map[string]string
Automated bool
Locked bool
Ignore bool
Policies map[string]string
}
// --- config types
type GitRemoteConfig struct {
URL string `json:"url"`
Branch string `json:"branch"`
Path string `json:"path"`
}
type GitConfig struct {
Remote GitRemoteConfig `json:"remote"`
PublicSSHKey ssh.PublicKey `json:"publicSSHKey"`
Status git.GitRepoStatus `json:"status"`
}
type Deprecated interface {
SyncNotify(context.Context) error
}
type NotDeprecated interface {
// from v5
Export(context.Context) ([]byte, error)
// v6
ListServices(ctx context.Context, namespace string) ([]ControllerStatus, error)
ListImages(ctx context.Context, spec update.ResourceSpec) ([]ImageStatus, error)
UpdateManifests(context.Context, update.Spec) (job.ID, error)
SyncStatus(ctx context.Context, ref string) ([]string, error)
JobStatus(context.Context, job.ID) (job.Status, error)
GitRepoConfig(ctx context.Context, regenerate bool) (GitConfig, error)
}
type Upstream interface {
// from v4
Ping(context.Context) error
Version(context.Context) (string, error)
}
type Server interface {
Deprecated
NotDeprecated
}