Class: Keel::GCloud::Interactions
- Inherits:
-
Object
- Object
- Keel::GCloud::Interactions
- Defined in:
- lib/keel/gcloud/interactions.rb
Overview
A helper for prompts that integrate other services
Constant Summary collapse
- @@namespace =
nil- @@label =
nil
Class Method Summary collapse
-
.pick_image_label(label) ⇒ Object
Prompts for a Docker image label if one has not already been selected.
-
.pick_namespace(namespace) ⇒ Object
Prompts for the deployment namespace if there are multiple available and one has not been already chosen.
Class Method Details
.pick_image_label(label) ⇒ Object
Prompts for a Docker image label if one has not already been selected
33 34 35 36 37 38 39 |
# File 'lib/keel/gcloud/interactions.rb', line 33 def self.pick_image_label(label) unless @@label prompter = Keel::GCloud::Prompter.new @@label = prompter.prompt_for_label label end @@label end |
.pick_namespace(namespace) ⇒ Object
Prompts for the deployment namespace if there are multiple available and one has not been already chosen
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/keel/gcloud/interactions.rb', line 15 def self.pick_namespace(namespace) unless @@namespace prompter = Keel::GCloud::Prompter.new namespaces = Keel::GCloud::Kubernetes::Namespace.fetch_all unless namespaces = 'Unable to connect to Kubernetes, please try again later...' prompter.print , :error abort end @@namespace = prompter.prompt_for_namespace namespaces, namespace end @@namespace end |