-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still use KubernetesDeploy public api for exes, errors and integratio…
…n tests
- Loading branch information
Douglas Soares de Andrade
committed
Oct 26, 2019
1 parent
6664b95
commit c80ae60
Showing
13 changed files
with
77 additions
and
19 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
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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
# frozen_string_literal: true | ||
require 'krane/deprecated_deploy_task' | ||
require_relative 'rescue_krane_exceptions' | ||
|
||
module KubernetesDeploy | ||
class DeployTask < ::Krane::DeprecatedDeployTask | ||
include RescueKraneExceptions | ||
|
||
def run(*args) | ||
super(*args) | ||
rescue KubernetesDeploy::FatalDeploymentError | ||
false | ||
end | ||
end | ||
end |
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,8 @@ | ||
# frozen_string_literal: true | ||
|
||
module KubernetesDeploy | ||
class FatalDeploymentError < StandardError; end | ||
class FatalKubeAPIError < FatalDeploymentError; end | ||
class KubectlError < StandardError; end | ||
class DeploymentTimeoutError < FatalDeploymentError; end | ||
end |
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,7 +1,15 @@ | ||
# frozen_string_literal: true | ||
require 'krane/render_task' | ||
require_relative 'rescue_krane_exceptions' | ||
|
||
module KubernetesDeploy | ||
class RenderTask < ::Krane::RenderTask | ||
include RescueKraneExceptions | ||
|
||
def run(*args) | ||
super(*args) | ||
rescue KubernetesDeploy::FatalDeploymentError | ||
false | ||
end | ||
end | ||
end |
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,16 @@ | ||
# frozen_string_literal: true | ||
require_relative 'errors' | ||
|
||
module RescueKraneExceptions | ||
def run!(*args) | ||
super(*args) | ||
rescue Krane::DeploymentTimeoutError => e | ||
raise KubernetesDeploy::DeploymentTimeoutError, e.message | ||
rescue Krane::FatalDeploymentError => e | ||
raise KubernetesDeploy::FatalDeploymentError, e.message | ||
rescue Krane::FatalKubeAPIError => e | ||
raise KubernetesDeploy::FatalKubeAPIError, e.message | ||
rescue Krane::KubectlError => e | ||
raise KubernetesDeploy::KubectlError, e.message | ||
end | ||
end |
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,7 +1,15 @@ | ||
# frozen_string_literal: true | ||
require 'krane/restart_task' | ||
require_relative 'rescue_krane_exceptions' | ||
|
||
module KubernetesDeploy | ||
class RestartTask < ::Krane::RestartTask | ||
include RescueKraneExceptions | ||
|
||
def run(*args) | ||
super(*args) | ||
rescue KubernetesDeploy::FatalDeploymentError | ||
false | ||
end | ||
end | ||
end |
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,7 +1,15 @@ | ||
# frozen_string_literal: true | ||
require 'krane/runner_task' | ||
require_relative 'rescue_krane_exceptions' | ||
|
||
module KubernetesDeploy | ||
class RunnerTask < ::Krane::RunnerTask | ||
include RescueKraneExceptions | ||
|
||
def run(*args) | ||
super(*args) | ||
rescue KubernetesDeploy::DeploymentTimeoutError, KubernetesDeploy::FatalDeploymentError | ||
false | ||
end | ||
end | ||
end |
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