Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
conditions: remove unused constants
Browse files Browse the repository at this point in the history
Most of these have been moved into the controllers themselves, and while
that's not necessarily ideal, it's much better than a random "utils"
package.
  • Loading branch information
juliogreff committed Jan 8, 2020
1 parent 8a854f2 commit 2db1247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
25 changes: 1 addition & 24 deletions pkg/util/conditions/constants.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
package conditions

const (
// Operational.
ServerError = "ServerError"

// Capacity Ready.
MissingDeployment = "MissingDeployment"
TooManyDeployments = "TooManyDeployments"
PodsNotReady = "PodsNotReady"
WrongPodCount = "WrongPodCount"

MissingObjects = "MissingObjects"
InvalidObjects = "InvalidObjects"

MissingService = "MissingService"

UnknownError = "UnknownError"

InternalError = "InternalError"

ServerError = "ServerError"
TargetClusterClientError = "TargetClusterClientError"

CreateReleaseFailed = "CreateReleaseFailed"
ChartVersionResolutionFailed = "ChartVersionResolutionFailed"
FetchReleaseFailed = "FetchReleaseFailed"
BrokenReleaseGeneration = "BrokenReleaseGeneration"
BrokenApplicationObservedGeneration = "BrokenApplicationObservedGeneration"
StrategyExecutionFailed = "StrategyExecutionFailed"

ChartError = "ChartError"
ClientError = "ClientError"

ClustersNotReady = "ClustersNotReady"
)
8 changes: 4 additions & 4 deletions pkg/util/conditions/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestFalseToFalse(t *testing.T) {
sc.SetFalse(ct, StrategyConditionsUpdate{
Step: 0,
LastTransitionTime: createTime,
Reason: ClustersNotReady,
Reason: "ClustersNotReady",
})

testTransitionAndUpdateTimes(t, sc, ct, createTime, updateTime)
Expand Down Expand Up @@ -185,7 +185,7 @@ func TestUnknownToFalse(t *testing.T) {
sc.SetFalse(
ct,
StrategyConditionsUpdate{
Reason: ClustersNotReady,
Reason: "ClustersNotReady",
Step: 0,
LastTransitionTime: transitionTime,
})
Expand All @@ -209,7 +209,7 @@ func TestContenderStateWaitingForCapacity(t *testing.T) {
shipper.ReleaseStrategyCondition{
Type: shipper.StrategyConditionContenderAchievedCapacity,
Status: corev1.ConditionFalse,
Reason: ClustersNotReady,
Reason: "ClustersNotReady",
Step: step1,
},
shipper.ReleaseStrategyCondition{
Expand Down Expand Up @@ -256,7 +256,7 @@ func TestContenderStateWaitingForTraffic(t *testing.T) {
shipper.ReleaseStrategyCondition{
Type: shipper.StrategyConditionContenderAchievedCapacity,
Status: corev1.ConditionTrue,
Reason: ClustersNotReady,
Reason: "ClustersNotReady",
Step: step1,
},
shipper.ReleaseStrategyCondition{
Expand Down

0 comments on commit 2db1247

Please sign in to comment.