-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from olevchyk/master
AlreadyExistsException check on stackcreation.
- Loading branch information
Showing
5 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package provider | ||
|
||
type AlreadyExistsError struct { | ||
msg string | ||
} | ||
|
||
type DoesNotExistError struct { | ||
msg string | ||
} | ||
|
||
func (error *AlreadyExistsError) Error() string { | ||
return error.msg | ||
} | ||
|
||
func (error *DoesNotExistError) Error() string { | ||
return error.msg | ||
} | ||
|
||
func NewAlreadyExistsError(msg string) error { | ||
return &AlreadyExistsError{msg} | ||
} | ||
|
||
func NewDoesNotExistError(msg string) error { | ||
return &DoesNotExistError{msg} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,8 @@ | ||
package provider | ||
|
||
import ( | ||
log "github.com/sirupsen/logrus" | ||
"github.com/szuecs/kube-static-egress-controller/provider/aws" | ||
"github.com/szuecs/kube-static-egress-controller/provider/noop" | ||
) | ||
|
||
type Provider interface { | ||
Create([]string) error | ||
Update([]string) error | ||
Delete() error | ||
String() string | ||
} | ||
|
||
func NewProvider(dry bool, name string, natCidrBlocks, availabilityZones []string, StackTerminationProtection bool) Provider { | ||
switch name { | ||
case aws.ProviderName: | ||
return aws.NewAwsProvider(dry, natCidrBlocks, availabilityZones, StackTerminationProtection) | ||
case noop.ProviderName: | ||
return noop.NewNoopProvider() | ||
default: | ||
log.Fatalf("Unkown provider: %s", name) | ||
} | ||
return nil | ||
} |