Skip to content

Instantly share code, notes, and snippets.

View jameswnl's full-sized avatar

James Wong jameswnl

View GitHub Profile
@jameswnl
jameswnl / conversion_host_spec.rb
Last active February 8, 2019 21:16
spec stub method
require "MiqSshUtil"
describe ConversionHost do
let(:apst) { FactoryBot.create(:service_template_ansible_playbook) }
let(:host) { FactoryBot.create(:host) }
let(:vm) { FactoryBot.create(:vm_or_template) }
before do
allow(vm).to receive(:supports_conversion_host?).and_return(true)
allow(host).to receive(:supports_conversion_host?).and_return(true)
vagrant@minikf:~/kfv1$ kfctl generate all -V
INFO[0000] Ksonnet.Generate Name AppDir Platform filename="ksonnet/ksonnet.go:369"
INFO[0000] Creating environment "default" with namespace "default", pointing to "version:v1.13.2" cluster at address "https://10.10.10.10:8443" filename="env/create.go:77"
INFO[0003] Generating ksonnet-lib data at path 'ks_app/lib/ksonnet-lib/v1.13.2' filename="lib/lib.go:148"
INFO[0003] Successfully initialized the app . filename="ksonnet/ksonnet.go:505"
INFO[0003] App add registry kubeflow URI filename="ksonnet/ksonnet.go:621"
Error: couldn't generate KfApp: (kubeflow.error): Code 500 with message: kfApp Generate failed for ksonnet: (kubeflow.error): Code 400 with message: couldn't add registry kubeflow. Error: there was a problem adding registry kubeflow: initializing helm HTTP client: normalizing Helm repository URL: "" is an invalid scheme for Helm repository
Usage:
kfctl generate [all(=default)|k8s|platform] [flags]
@jameswnl
jameswnl / port-forward.sh
Created July 10, 2020 20:58
script to port forwarding to the test-data-generator pod
#!/bin/sh
oc project tower-analytics-$1. # expect either ci or qa
if [ $? -eq 1 ]; then
echo "oc project tower-analytics-$0 failed. Abort"
exit 1
fi
for i in $(oc get pods -o name);
do
echo $i
#!/bin/sh
set -o errexit
set -o pipefail
######### postgres_ready #########
postgres_ready() {
python << END
import logging
import os