This repository has been archived on 2023-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
gitea.kosmos.org/script/get_secrets
Greg Karékinian eba722992f Copy the labels to the persistent data volume
Move the custom label definitions to a custom folder in the kubernetes
folder, as well as the config files
2019-02-05 20:29:08 +01:00

16 lines
336 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'yaml'
require 'base64'
secret = `kubectl get secret gitea-config -o yaml`
yaml = YAML.load(secret)
yaml['data'].each do |key, data|
filename = File.join('kubernetes', 'custom', 'config', key)
File.open(filename, "w+") do |f|
puts "Writing #{filename}"
f.write Base64.decode64(data)
end
end