-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global deploy 2 #602
Merged
Merged
Global deploy 2 #602
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f1509a
Global command with a ResourceDeployer class
dturn 4f18c8c
Move validations back into (Global)DeployTask
dturn 96d3af0
Test updates
dturn f5df217
Add more global integration tests
dturn 437976d
Fix class name
dturn 57f3306
Add an extra test around namespaced CRs
dturn d7de6cc
PR feedback and improvements
dturn fa17169
Fix up tests from rebasing
dturn ca5dc27
Update to task config defaulting
dturn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,10 @@ class GlobalDeployTask | |
# @param global_timeout [Integer] Timeout in seconds | ||
# @param selector [Hash] Selector(s) parsed by Krane::LabelSelector | ||
# @param template_paths [Array<String>] An array of template paths | ||
def initialize(context:, global_timeout: nil, selector: nil, filenames: []) | ||
def initialize(context:, global_timeout: nil, selector: nil, filenames: [], logger: nil) | ||
template_paths = filenames.map { |path| File.expand_path(path) } | ||
|
||
@task_config = TaskConfig.new(context, nil) | ||
@task_config = TaskConfig.new(context, nil, logger) | ||
@template_sets = TemplateSets.from_dirs_and_files(paths: template_paths, | ||
logger: @task_config.logger) | ||
@global_timeout = global_timeout | ||
|
@@ -116,7 +116,7 @@ def validate_configuration | |
errors = [] | ||
errors += task_config_validator.errors | ||
errors += @template_sets.validate | ||
errors << "Selector is required" unless @selector.present? | ||
errors << "Selector is required" unless @selector.to_h.present? | ||
unless errors.empty? | ||
add_para_from_list(logger: logger, action: "Configuration invalid", enum: errors) | ||
raise TaskConfigurationError | ||
|
@@ -159,7 +159,7 @@ def validate_globals(resources) | |
namespaced_names = FormattedLogger.indent_four(namespaced_names.join("\n")) | ||
|
||
logger.summary.add_paragraph(ColorizedString.new("Namespaced resources:\n#{namespaced_names}").yellow) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is another place I'm thinking that a new list-based summary helper would be handy |
||
raise FatalDeploymentError, "Deploying namespaced resource is not allowed from this command." | ||
raise FatalDeploymentError, "This command cannot deploy namespaced resources" | ||
end | ||
|
||
def discover_resources | ||
|
@@ -186,7 +186,7 @@ def cluster_resource_discoverer | |
end | ||
|
||
def statsd_tags | ||
%W(context:#{@context}) | ||
%W(context:#{context}) | ||
end | ||
|
||
def kubectl | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's default this like the old task does, so they don't have to pass one in.