GitOps for k8s
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

api.go 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package v6
  2. import (
  3. "context"
  4. "github.com/fluxcd/flux/cluster"
  5. "github.com/fluxcd/flux/git"
  6. "github.com/fluxcd/flux/job"
  7. "github.com/fluxcd/flux/resource"
  8. "github.com/fluxcd/flux/ssh"
  9. "github.com/fluxcd/flux/update"
  10. )
  11. type ImageStatus struct {
  12. ID resource.ID
  13. Containers []Container
  14. }
  15. // ReadOnlyReason enumerates the reasons that a controller is
  16. // considered read-only. The zero value is considered "OK", since the
  17. // zero value is what prior versions of the daemon will effectively
  18. // send.
  19. type ReadOnlyReason string
  20. const (
  21. ReadOnlyOK ReadOnlyReason = ""
  22. ReadOnlyMissing ReadOnlyReason = "NotInRepo"
  23. ReadOnlySystem ReadOnlyReason = "System"
  24. ReadOnlyNoRepo ReadOnlyReason = "NoRepo"
  25. ReadOnlyNotReady ReadOnlyReason = "NotReady"
  26. ReadOnlyROMode ReadOnlyReason = "ReadOnlyMode"
  27. )
  28. type ControllerStatus struct {
  29. ID resource.ID
  30. Containers []Container
  31. ReadOnly ReadOnlyReason
  32. Status string
  33. Rollout cluster.RolloutStatus
  34. SyncError string
  35. Antecedent resource.ID
  36. Labels map[string]string
  37. Automated bool
  38. Locked bool
  39. Ignore bool
  40. Policies map[string]string
  41. }
  42. // --- config types
  43. type GitRemoteConfig struct {
  44. URL string `json:"url"`
  45. Branch string `json:"branch"`
  46. Path string `json:"path"`
  47. }
  48. type GitConfig struct {
  49. Remote GitRemoteConfig `json:"remote"`
  50. PublicSSHKey ssh.PublicKey `json:"publicSSHKey"`
  51. Status git.GitRepoStatus `json:"status"`
  52. }
  53. type Deprecated interface {
  54. SyncNotify(context.Context) error
  55. }
  56. type NotDeprecated interface {
  57. // from v5
  58. Export(context.Context) ([]byte, error)
  59. // v6
  60. ListServices(ctx context.Context, namespace string) ([]ControllerStatus, error)
  61. ListImages(ctx context.Context, spec update.ResourceSpec) ([]ImageStatus, error)
  62. UpdateManifests(context.Context, update.Spec) (job.ID, error)
  63. SyncStatus(ctx context.Context, ref string) ([]string, error)
  64. JobStatus(context.Context, job.ID) (job.Status, error)
  65. GitRepoConfig(ctx context.Context, regenerate bool) (GitConfig, error)
  66. }
  67. type Upstream interface {
  68. // from v4
  69. Ping(context.Context) error
  70. Version(context.Context) (string, error)
  71. }
  72. type Server interface {
  73. Deprecated
  74. NotDeprecated
  75. }