Class: Hippo::DeploymentMonitor::Poll

Inherits:
Object
  • Object
show all
Defined in:
lib/hippo/deployment_monitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stage, deployment_id) ⇒ Poll

Returns a new instance of Poll.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/hippo/deployment_monitor.rb', line 47

def initialize(stage, deployment_id)
  @stage = stage
  @deployment_id = deployment_id

  @replica_sets = @stage.get(
    'rs',
    '--selector',
    'hippo.adam.ac/deployID=' + @deployment_id
  )

  @pending = @replica_sets.reject do |deploy|
    deploy['status']['availableReplicas'] == deploy['status']['replicas']
  end
end

Instance Attribute Details

#pendingObject (readonly)

Returns the value of attribute pending.



62
63
64
# File 'lib/hippo/deployment_monitor.rb', line 62

def pending
  @pending
end

#replica_setsObject (readonly)

Returns the value of attribute replica_sets.



63
64
65
# File 'lib/hippo/deployment_monitor.rb', line 63

def replica_sets
  @replica_sets
end

Instance Method Details

#namesObject



69
70
71
# File 'lib/hippo/deployment_monitor.rb', line 69

def names
  make_names(@replica_sets)
end

#pending_namesObject



65
66
67
# File 'lib/hippo/deployment_monitor.rb', line 65

def pending_names
  make_names(@pending)
end