Skip to content

Commit

Permalink
Refactor validation func
Browse files Browse the repository at this point in the history
Signed-off-by: t-kikuc <[email protected]>
  • Loading branch information
t-kikuc committed Nov 27, 2023
1 parent 5e2e676 commit 840f2ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/config/application_ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *ECSApplicationSpec) Validate() error {
return err
}

if err := s.Input.validateAccessType(); err != nil {
if err := s.Input.validate(); err != nil {
return err
}

Expand Down Expand Up @@ -143,11 +143,12 @@ func (opts ECSTrafficRoutingStageOptions) Percentage() (primary, canary int) {
return
}

func (in *ECSDeploymentInput) validateAccessType() error {
func (in *ECSDeploymentInput) validate() error {
switch in.AccessType {
case AccessTypeELB, AccessTypeServiceDiscovery:
return nil
break
default:
return fmt.Errorf("invalid accessType: %s", in.AccessType)
}
return nil
}

0 comments on commit 840f2ce

Please sign in to comment.