Skip to content

Commit 9d54528

Browse files
authored
Merge pull request #97 from fluxcd/impl-meta-api
Implement `fluxcd/pkg/apis/meta` in APIs
2 parents ddcbd1c + 8129c49 commit 9d54528

File tree

14 files changed

+522
-577
lines changed

14 files changed

+522
-577
lines changed

api/go.mod

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ module github.com/fluxcd/helm-controller/api
33
go 1.14
44

55
require (
6-
github.com/fluxcd/pkg/runtime v0.0.3
7-
k8s.io/api v0.18.8
8-
k8s.io/apiextensions-apiserver v0.18.8
9-
k8s.io/apimachinery v0.18.8
10-
sigs.k8s.io/controller-runtime v0.6.2
6+
github.com/fluxcd/pkg/apis/meta v0.0.2
7+
github.com/fluxcd/pkg/runtime v0.0.6
8+
k8s.io/api v0.18.9
9+
k8s.io/apiextensions-apiserver v0.18.9
10+
k8s.io/apimachinery v0.18.9
11+
sigs.k8s.io/controller-runtime v0.6.3
1112
)

api/go.sum

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l
2525
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
2626
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
2727
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
28-
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
2928
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
3029
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
3130
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -58,12 +57,14 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
5857
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
5958
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
6059
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
61-
github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc=
6260
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
6361
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
62+
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
6463
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
65-
github.com/fluxcd/pkg/runtime v0.0.3 h1:x9rOThl1qh5srIUpW0YHEj1I84swMj5m76UqrR1QknY=
66-
github.com/fluxcd/pkg/runtime v0.0.3/go.mod h1:ECBTeplxhgbCJYIjmtwn3ZS0A91/+6YtOS4w2G0LeK4=
64+
github.com/fluxcd/pkg/apis/meta v0.0.2 h1:kyA4Y0IzNjf1joBOnFqpWG7aNDHvtLExZcaHQM7qhRI=
65+
github.com/fluxcd/pkg/apis/meta v0.0.2/go.mod h1:nCNps5JJOcEQr3MNDmZqI4o0chjePSUYL6Q2ktDtotU=
66+
github.com/fluxcd/pkg/runtime v0.0.6 h1:m7qwr2wRePs1vzVlM0Y88vitXSsv1lb3QCJflRpa3qQ=
67+
github.com/fluxcd/pkg/runtime v0.0.6/go.mod h1:iLjncjktQVpqpb1NsY2fW+UYDFOtVyt+yJrxqrrK8A0=
6768
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
6869
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
6970
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -172,7 +173,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
172173
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
173174
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
174175
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
175-
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
176176
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
177177
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
178178
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -421,22 +421,22 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
421421
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
422422
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
423423
k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI=
424-
k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4=
425-
k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY=
424+
k8s.io/api v0.18.9 h1:7VDtivqwbvLOf8hmXSd/PDSSbpCBq49MELg84EYBYiQ=
425+
k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc=
426426
k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M=
427-
k8s.io/apiextensions-apiserver v0.18.8 h1:pkqYPKTHa0/3lYwH7201RpF9eFm0lmZDFBNzhN+k/sA=
428-
k8s.io/apiextensions-apiserver v0.18.8/go.mod h1:7f4ySEkkvifIr4+BRrRWriKKIJjPyg9mb/p63dJKnlM=
427+
k8s.io/apiextensions-apiserver v0.18.9 h1:tVEf8rVKh5BnXORnYYCztjbf6CSyGNMt/rAIEyfU00Q=
428+
k8s.io/apiextensions-apiserver v0.18.9/go.mod h1:JagmAhU0TVENzgUZqHJsjCSDh7YuV5o6g01G1Fwh7zI=
429429
k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko=
430-
k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0=
431-
k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig=
430+
k8s.io/apimachinery v0.18.9 h1:3ZABKQx3F3xPWlsGhCfUl8W+JXRRblV6Wo2A3zn0pvY=
431+
k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk=
432432
k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg=
433-
k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM=
433+
k8s.io/apiserver v0.18.9/go.mod h1:vXQzMtUCLsGg1Bh+7Jo2mZKHpHZFCZn8eTNSepcIA1M=
434434
k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q=
435-
k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU=
435+
k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY=
436436
k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
437-
k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
437+
k8s.io/code-generator v0.18.9/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
438438
k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14=
439-
k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU=
439+
k8s.io/component-base v0.18.9/go.mod h1:tUo4qZtV8m7t/U+0DgY+fcnn4BFZ480fZdzxOkWH4zk=
440440
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
441441
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
442442
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
@@ -449,8 +449,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
449449
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE=
450450
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
451451
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0=
452-
sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA=
453-
sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E=
452+
sigs.k8s.io/controller-runtime v0.6.3 h1:SBbr+inLPEKhvlJtrvDcwIpm+uhDvp63Bl72xYJtoOE=
453+
sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY=
454454
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
455455
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E=
456456
sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=

api/v2alpha1/condition_types.go

Lines changed: 32 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -16,103 +16,70 @@ limitations under the License.
1616

1717
package v2alpha1
1818

19-
import (
20-
corev1 "k8s.io/api/core/v1"
21-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
)
23-
24-
// Condition contains condition information for a HelmRelease.
25-
type Condition struct {
26-
// Type of the condition, one of ('Ready', 'Install', 'Upgrade', 'Test', 'Rollback', 'Uninstall').
27-
// +required
28-
Type string `json:"type"`
29-
30-
// Status of the condition, one of ('True', 'False', 'Unknown').
31-
// +required
32-
Status corev1.ConditionStatus `json:"status"`
33-
34-
// LastTransitionTime is the timestamp corresponding to the last status
35-
// change of this condition.
36-
// +required
37-
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
38-
39-
// Reason is a brief machine readable explanation for the condition's last
40-
// transition.
41-
// +required
42-
Reason string `json:"reason,omitempty"`
43-
44-
// Message is a human readable description of the details of the last
45-
// transition, complementing reason.
46-
// +optional
47-
Message string `json:"message,omitempty"`
48-
}
49-
5019
const (
51-
// ReadyCondition represents the fact that the HelmRelease has been successfully reconciled.
52-
ReadyCondition string = "Ready"
53-
54-
// ReleasedCondition represents the fact that the HelmRelease has been successfully released.
20+
// ReleasedCondition represents the fact that the HelmRelease has been
21+
// successfully released.
5522
ReleasedCondition string = "Released"
5623

57-
// TestSuccessCondition represents the fact that the tests for the HelmRelease are succeeding.
24+
// TestSuccessCondition represents the fact that the tests for the HelmRelease
25+
// are succeeding.
5826
TestSuccessCondition string = "TestSuccess"
5927

60-
// RemediatedCondition represents the fact that the HelmRelease has been successfully remediated.
28+
// RemediatedCondition represents the fact that the HelmRelease has been
29+
// successfully remediated.
6130
RemediatedCondition string = "Remediated"
6231
)
6332

6433
const (
65-
// ReconciliationSucceededReason represents the fact that the reconciliation of the HelmRelease has succeeded.
66-
ReconciliationSucceededReason string = "ReconciliationSucceeded"
67-
68-
// ReconciliationFailedReason represents the fact that the reconciliation of the HelmRelease has failed.
69-
ReconciliationFailedReason string = "ReconciliationFailed"
70-
71-
// InstallSucceededReason represents the fact that the Helm install for the HelmRelease succeeded.
34+
// InstallSucceededReason represents the fact that the Helm install for the
35+
// HelmRelease succeeded.
7236
InstallSucceededReason string = "InstallSucceeded"
7337

74-
// InstallFailedReason represents the fact that the Helm install for the HelmRelease failed.
38+
// InstallFailedReason represents the fact that the Helm install for the
39+
// HelmRelease failed.
7540
InstallFailedReason string = "InstallFailed"
7641

77-
// UpgradeSucceededReason represents the fact that the Helm upgrade for the HelmRelease succeeded.
42+
// UpgradeSucceededReason represents the fact that the Helm upgrade for the
43+
// HelmRelease succeeded.
7844
UpgradeSucceededReason string = "UpgradeSucceeded"
7945

80-
// UpgradeFailedReason represents the fact that the Helm upgrade for the HelmRelease failed.
46+
// UpgradeFailedReason represents the fact that the Helm upgrade for the
47+
// HelmRelease failed.
8148
UpgradeFailedReason string = "UpgradeFailed"
8249

83-
// TestSucceededReason represents the fact that the Helm tests for the HelmRelease succeeded.
50+
// TestSucceededReason represents the fact that the Helm tests for the
51+
// HelmRelease succeeded.
8452
TestSucceededReason string = "TestSucceeded"
8553

86-
// TestFailedReason represents the fact that the Helm tests for the HelmRelease failed.
54+
// TestFailedReason represents the fact that the Helm tests for the HelmRelease
55+
// failed.
8756
TestFailedReason string = "TestsFailed"
8857

89-
// RollbackSucceededReason represents the fact that the Helm rollback for the HelmRelease succeeded.
58+
// RollbackSucceededReason represents the fact that the Helm rollback for the
59+
// HelmRelease succeeded.
9060
RollbackSucceededReason string = "RollbackSucceeded"
9161

92-
// RollbackFailedReason represents the fact that the Helm test for the HelmRelease failed.
62+
// RollbackFailedReason represents the fact that the Helm test for the
63+
// HelmRelease failed.
9364
RollbackFailedReason string = "RollbackFailed"
9465

95-
// UninstallSucceededReason represents the fact that the Helm uninstall for the HelmRelease succeeded.
66+
// UninstallSucceededReason represents the fact that the Helm uninstall for the
67+
// HelmRelease succeeded.
9668
UninstallSucceededReason string = "UninstallSucceeded"
9769

98-
// UninstallFailedReason represents the fact that the Helm uninstall for the HelmRelease failed.
70+
// UninstallFailedReason represents the fact that the Helm uninstall for the
71+
// HelmRelease failed.
9972
UninstallFailedReason string = "UninstallFailed"
10073

101-
// ArtifactFailedReason represents the fact that the artifact download for the HelmRelease failed.
74+
// ArtifactFailedReason represents the fact that the artifact download for the
75+
// HelmRelease failed.
10276
ArtifactFailedReason string = "ArtifactFailed"
10377

104-
// InitFailedReason represents the fact that the initialization of the Helm configuration failed.
78+
// InitFailedReason represents the fact that the initialization of the Helm
79+
// configuration failed.
10580
InitFailedReason string = "InitFailed"
10681

107-
// GetLastReleaseFailedReason represents the fact that observing the last release failed.
82+
// GetLastReleaseFailedReason represents the fact that observing the last
83+
// release failed.
10884
GetLastReleaseFailedReason string = "GetLastReleaseFailed"
109-
110-
// ProgressingReason represents the fact that the reconciliation for the resource is underway.
111-
ProgressingReason string = "Progressing"
112-
113-
// DependencyNotReadyReason represents the fact that the one of the dependencies is not ready.
114-
DependencyNotReadyReason string = "DependencyNotReady"
115-
116-
// SuspendedReason represents the fact that the reconciliation of the HelmRelease is suspended.
117-
SuspendedReason string = "Suspended"
11885
)

0 commit comments

Comments
 (0)