Skip to content

Commit

Permalink
more dinosaur replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes94 committed Oct 9, 2024
1 parent e5ae43b commit 3b06cef
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions internal/dinosaur/pkg/services/dinosaur.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ var (
}
)

// DinosaurRoutesAction ...
type DinosaurRoutesAction string
// CentralRoutesAction ...
type CentralRoutesAction string

// DinosaurRoutesActionCreate ...
const DinosaurRoutesActionCreate DinosaurRoutesAction = "CREATE"
// CentralRoutesActionCreate ...
const CentralRoutesActionCreate CentralRoutesAction = "CREATE"

// DinosaurRoutesActionDelete ...
const DinosaurRoutesActionDelete DinosaurRoutesAction = "DELETE"
// CentralRoutesActionDelete ...
const CentralRoutesActionDelete CentralRoutesAction = "DELETE"

const gracePeriod = 14 * 24 * time.Hour

Expand Down Expand Up @@ -96,7 +96,7 @@ type DinosaurService interface {
// Use this only when you want to update the multiple columns that may contain zero-fields, otherwise use the `DinosaurService.Update()` method.
// See https://gorm.io/docs/update.html#Updates-multiple-columns for more info
Updates(dinosaurRequest *dbapi.CentralRequest, values map[string]interface{}) *errors.ServiceError
ChangeCentralCNAMErecords(dinosaurRequest *dbapi.CentralRequest, action DinosaurRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *errors.ServiceError)
ChangeCentralCNAMErecords(dinosaurRequest *dbapi.CentralRequest, action CentralRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *errors.ServiceError)
GetCNAMERecordStatus(dinosaurRequest *dbapi.CentralRequest) (*CNameRecordStatus, error)
DetectInstanceType(dinosaurRequest *dbapi.CentralRequest) types.DinosaurInstanceType
RegisterDinosaurDeprovisionJob(ctx context.Context, id string) *errors.ServiceError
Expand Down Expand Up @@ -594,7 +594,7 @@ func (k *dinosaurService) Delete(centralRequest *dbapi.CentralRequest, force boo
}
// Only delete the routes when they are set
if routes != nil && k.centralConfig.EnableCentralExternalCertificate {
_, err := k.ChangeCentralCNAMErecords(centralRequest, DinosaurRoutesActionDelete)
_, err := k.ChangeCentralCNAMErecords(centralRequest, CentralRoutesActionDelete)
if err != nil {
if force {
glog.Warningf("Failed to delete CNAME records for Central tenant %q: %v", centralRequest.ID, err)
Expand Down Expand Up @@ -775,7 +775,7 @@ func (k *dinosaurService) UpdateStatus(id string, status dinosaurConstants.Centr
}

// ChangeCentralCNAMErecords ...
func (k *dinosaurService) ChangeCentralCNAMErecords(centralRequest *dbapi.CentralRequest, action DinosaurRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *errors.ServiceError) {
func (k *dinosaurService) ChangeCentralCNAMErecords(centralRequest *dbapi.CentralRequest, action CentralRoutesAction) (*route53.ChangeResourceRecordSetsOutput, *errors.ServiceError) {
routes, err := centralRequest.GetRoutes()
if routes == nil || err != nil {
return nil, errors.NewWithCause(errors.ErrorGeneral, err, "failed to get routes")
Expand Down
14 changes: 7 additions & 7 deletions internal/dinosaur/pkg/services/dinosaurservice_moq.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (k *CentralRoutesCNAMEManager) Reconcile() []error {
if central.RoutesCreationID == "" {
glog.Infof("creating CNAME records for central %s", central.ID)

changeOutput, err := k.centralService.ChangeCentralCNAMErecords(central, services.DinosaurRoutesActionCreate)
changeOutput, err := k.centralService.ChangeCentralCNAMErecords(central, services.CentralRoutesActionCreate)

if err != nil {
errs = append(errs, err)
Expand Down

0 comments on commit 3b06cef

Please sign in to comment.