Compare commits

..

No commits in common. "8e9a37b477dcf8276f8cb2ff43e67fb6be718818" and "bb7f309b34559fb3eee565b354e5e6cad395c549" have entirely different histories.

4 changed files with 20 additions and 11 deletions

24
app.rb
View File

@ -21,7 +21,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + "/lib"
require "config"
VERSION = "0.1.4"
VERSION = "0.1.3"
CHUNK_SIZE = 1024**2
SESSION_SECRET_HEX_LENGTH = 64
@ -117,6 +117,7 @@ class TickTock
def initialize
@pid = ppid
@procfs_f = format "/proc/%s/stat", @pid
puts @pid
end
def uptime
@ -184,11 +185,20 @@ class Sleep
end
def ppid
pid = ENV.fetch "PUMA_PID", Process.pid
begin
Integer pid
rescue ArgumentError
-1
pid = Process.pid
# self
ps = File.open "/proc/#{pid}/stat", &:readline
ps = ps.split(" ")
ppid = Integer(ps[3])
# ppid
ps = File.open "/proc/#{ppid}/stat", &:readline
ps = ps.split(" ")
if ps[1].include? "ruby"
ppid
else
pid
end
end
@ -374,7 +384,7 @@ post "/halt" do
nil
end
get "/pid", provides: "json" do
get "/pid" do
pretty = params.key? :pretty
jsonify({ppid: ppid, pid: Process.pid}, pretty:)

View File

@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.4
version: 0.1.3
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.4"
appVersion: "0.1.3"

View File

@ -1 +0,0 @@
ENV["PUMA_PID"] = Process.pid.to_s

View File

@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: kubernaut
image: git.kill0.net/ryanc/kubernaut:0.1.4
image: git.kill0.net/ryanc/kubernaut:0.1.3
imagePullPolicy: Always
ports:
- name: sinatra-web