module Kubes::Compiler::Shared::Helpers
Public Instance Methods
built_image()
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 15 def built_image Deprecated.new.built_image built_image_helper end
built_image_helper()
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 20 def built_image_helper path = Kubes.config.state.path unless File.exist?(path) raise Kubes::MissingDockerImage.new("Missing file with docker image built by kubes: #{path}. Try first running: kubes docker build") end data = JSON.load(IO.read(path)) data['image'] end
decode64(v)
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 43 def decode64(v) Base64.strict_decode64(v) end
docker_image()
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 9 def docker_image return @options[:image] if @options[:image] # override return Kubes.config.image if Kubes.config.image built_image_helper end
encode64(v)
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 38 def encode64(v) Base64.strict_encode64(v.to_s).strip end
Also aliased as: base64
extra()
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 33 def extra extra = ENV['KUBES_EXTRA'] extra&.strip&.empty? ? nil : extra # if blank string then also return nil end
with_extra(value)
click to toggle source
# File lib/kubes/compiler/shared/helpers.rb, line 29 def with_extra(value) [value, extra].compact.join('-') end