Class: Proxy::Omaha::Distribution::Flatcar

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_proxy_omaha/distribution.rb

Instance Method Summary collapse

Instance Method Details

#identifierObject



54
55
56
# File 'lib/smart_proxy_omaha/distribution.rb', line 54

def identifier
  :flatcar
end

#prefixObject



58
59
60
# File 'lib/smart_proxy_omaha/distribution.rb', line 58

def prefix
  'flatcar'
end

#releases(track, architecture) ⇒ Object



74
75
76
77
78
# File 'lib/smart_proxy_omaha/distribution.rb', line 74

def releases(track, architecture)
  feed_data = http_request.get("https://www.flatcar-linux.org/releases-json/releases-#{track}.json")
  json_feed = JSON.parse(feed_data)
  json_feed.select { |_, release| release['architectures'].include?(architecture.split('-').first) }.keys - ['current']
end

#update_filenameObject



62
63
64
# File 'lib/smart_proxy_omaha/distribution.rb', line 62

def update_filename
  'flatcar_production_update.gz'
end

#update_upstream(architecture, version) ⇒ Object



70
71
72
# File 'lib/smart_proxy_omaha/distribution.rb', line 70

def update_upstream(architecture, version)
  "https://update.release.flatcar-linux.net/#{architecture}/#{version}"
end

#upstream(track, architecture, version) ⇒ Object



66
67
68
# File 'lib/smart_proxy_omaha/distribution.rb', line 66

def upstream(track, architecture, version)
  "https://#{track}.release.flatcar-linux.net/#{architecture}/#{version}"
end