Sha256: 1af376c20835ad35ecea8b0e310096571e0c594e5cdba4ab8323e0753e479208

Contents?: true

Size: 759 Bytes

Versions: 34

Compression:

Stored size: 759 Bytes

Contents

module Vidar
  class DeployStatus
    INITIAL_SLEEP = 2
    SLEEP = 10
    MAX_TRIES = 30

    attr_reader :namespace, :filter, :max_tries

    def initialize(namespace:, filter: nil, max_tries: MAX_TRIES)
      @namespace = namespace
      @filter = filter
      @max_tries = max_tries
    end

    def wait_until_completed
      tries = 0

      sleep(INITIAL_SLEEP)

      until pod_set.deployed?
        tries += 1
        sleep(SLEEP)
        if tries > max_tries
          break
        end
      end
    end

    def success?
      return false unless last_pod_set
      last_pod_set.success?
    end

    def last_pod_set
      @pod_set
    end

    def pod_set
      @pod_set = K8s::PodSet.new(namespace: namespace, filter: filter)
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
vidar-1.4.2 lib/vidar/deploy_status.rb
vidar-1.4.1 lib/vidar/deploy_status.rb
vidar-1.4.0 lib/vidar/deploy_status.rb
vidar-1.3.2 lib/vidar/deploy_status.rb
vidar-1.3.1 lib/vidar/deploy_status.rb
vidar-1.3.0 lib/vidar/deploy_status.rb
vidar-1.2.0 lib/vidar/deploy_status.rb
vidar-1.1.5 lib/vidar/deploy_status.rb
vidar-1.1.4 lib/vidar/deploy_status.rb
vidar-1.1.3 lib/vidar/deploy_status.rb
vidar-1.1.2 lib/vidar/deploy_status.rb
vidar-1.1.1 lib/vidar/deploy_status.rb
vidar-1.1.0 lib/vidar/deploy_status.rb
vidar-1.0.0 lib/vidar/deploy_status.rb
vidar-0.13.1 lib/vidar/deploy_status.rb
vidar-0.13.0 lib/vidar/deploy_status.rb
vidar-0.12.1 lib/vidar/deploy_status.rb
vidar-0.12.0 lib/vidar/deploy_status.rb
vidar-0.11.0 lib/vidar/deploy_status.rb
vidar-0.10.2 lib/vidar/deploy_status.rb