Skip to content

Commit

Permalink
i/servicecat: Use consts for state change arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Jun 30, 2021
1 parent ee0a831 commit c410a9d
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions aws/internal/service/servicecatalog/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const (

RecordReadyTimeout = 3 * time.Minute

MinTimeout = 2 * time.Second
NotFoundChecks = 5
ContinuousTargetOccurrence = 2

StatusNotFound = "NOT_FOUND"
StatusUnavailable = "UNAVAILABLE"

Expand All @@ -63,9 +67,9 @@ func ProductReady(conn *servicecatalog.ServiceCatalog, acceptLanguage, productID
Target: []string{servicecatalog.StatusAvailable, StatusCreated},
Refresh: ProductStatus(conn, acceptLanguage, productID),
Timeout: ProductReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -235,9 +239,9 @@ func ConstraintReady(conn *servicecatalog.ServiceCatalog, acceptLanguage, id str
Target: []string{servicecatalog.StatusAvailable},
Refresh: ConstraintStatus(conn, acceptLanguage, id),
Timeout: ConstraintReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -268,9 +272,9 @@ func ProductPortfolioAssociationReady(conn *servicecatalog.ServiceCatalog, accep
Target: []string{servicecatalog.StatusAvailable},
Refresh: ProductPortfolioAssociationStatus(conn, acceptLanguage, portfolioID, productID),
Timeout: ProductPortfolioAssociationReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -395,9 +399,9 @@ func ProvisioningArtifactReady(conn *servicecatalog.ServiceCatalog, id, productI
Target: []string{servicecatalog.StatusAvailable, StatusCreated},
Refresh: ProvisioningArtifactStatus(conn, id, productID),
Timeout: ProvisioningArtifactReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -436,9 +440,9 @@ func PrincipalPortfolioAssociationReady(conn *servicecatalog.ServiceCatalog, acc
Target: []string{servicecatalog.StatusAvailable},
Refresh: PrincipalPortfolioAssociationStatus(conn, acceptLanguage, principalARN, portfolioID),
Timeout: PrincipalPortfolioAssociationReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -470,9 +474,9 @@ func LaunchPathsReady(conn *servicecatalog.ServiceCatalog, acceptLanguage, produ
Target: []string{servicecatalog.StatusAvailable},
Refresh: LaunchPathsStatus(conn, acceptLanguage, productID),
Timeout: LaunchPathsReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand All @@ -490,9 +494,9 @@ func ProvisionedProductReady(conn *servicecatalog.ServiceCatalog, acceptLanguage
Target: []string{servicecatalog.StatusAvailable},
Refresh: ProvisionedProductStatus(conn, acceptLanguage, id, name),
Timeout: ProvisionedProductReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down Expand Up @@ -523,9 +527,9 @@ func RecordReady(conn *servicecatalog.ServiceCatalog, acceptLanguage, id string)
Target: []string{servicecatalog.RecordStatusSucceeded, servicecatalog.StatusAvailable},
Refresh: RecordStatus(conn, acceptLanguage, id),
Timeout: RecordReadyTimeout,
ContinuousTargetOccurence: 2,
NotFoundChecks: 10,
MinTimeout: 10 * time.Second,
ContinuousTargetOccurence: ContinuousTargetOccurrence,
NotFoundChecks: NotFoundChecks,
MinTimeout: MinTimeout,
}

outputRaw, err := stateConf.WaitForState()
Expand Down

0 comments on commit c410a9d

Please sign in to comment.