Class: Gitlab::Kubernetes::Helm::V3::PatchCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Gitlab::Kubernetes::Helm::V3::PatchCommand
- Defined in:
- lib/gitlab/kubernetes/helm/v3/patch_command.rb
Constant Summary
Constants inherited from BaseCommand
Instance Attribute Summary collapse
-
#chart ⇒ Object
readonly
Returns the value of attribute chart.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from BaseCommand
Instance Method Summary collapse
- #generate_script ⇒ Object
-
#initialize(chart:, version:, repository: nil, **args) ⇒ PatchCommand
constructor
A new instance of PatchCommand.
Methods inherited from BaseCommand
#cluster_role_binding_resource, #config_map_resource, #env, #file_names, #pod_name, #pod_resource, #rbac?, #repository_command, #service_account_resource
Constructor Details
#initialize(chart:, version:, repository: nil, **args) ⇒ PatchCommand
Returns a new instance of PatchCommand.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/kubernetes/helm/v3/patch_command.rb', line 13 def initialize(chart:, version:, repository: nil, **args) super(**args) # version is mandatory to prevent chart mismatches # we do not want our values interpreted in the context of the wrong version raise ArgumentError, 'version is required' if version.blank? @chart = chart @version = version @repository = repository end |
Instance Attribute Details
#chart ⇒ Object (readonly)
Returns the value of attribute chart.
10 11 12 |
# File 'lib/gitlab/kubernetes/helm/v3/patch_command.rb', line 10 def chart @chart end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
10 11 12 |
# File 'lib/gitlab/kubernetes/helm/v3/patch_command.rb', line 10 def repository @repository end |
#version ⇒ Object
Returns the value of attribute version.
11 12 13 |
# File 'lib/gitlab/kubernetes/helm/v3/patch_command.rb', line 11 def version @version end |
Instance Method Details
#generate_script ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/gitlab/kubernetes/helm/v3/patch_command.rb', line 25 def generate_script super + [ repository_command, repository_update_command, upgrade_command ].compact.join("\n") end |