Skip to content

Instantly share code, notes, and snippets.

View austincunningham's full-sized avatar

Austin Cunningham austincunningham

View GitHub Profile
sudo dnf install rpmbuild
No match for argument: rpmbuild
Error: Unable to find a match: rpmbuild
npm run make
> electron-github@1.0.0 make /home/austincunningham/repo/electron-github
> electron-forge make
✔ Checking your system
✔ Resolving Forge Config
An unhandled rejection has occurred inside Forge:
Error: Cannot make for rpm, the following external binaries need to be installed: rpmbuild
npm run make
> electron-github@1.0.0 make /home/austincunningham/repo/electron-github
> electron-forge make
✔ Checking your system
✔ Resolving Forge Config
An unhandled rejection has occurred inside Forge:
Error: Cannot make for deb, the following external binaries need to be installed: dpkg, fakeroot
const { app, BrowserWindow } = require('electron')
const path = require('path')
const createWindow = () => {
const win = new BrowserWindow({
width: 1200,
height: 850,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
# get the service
oc get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
podroute-service ClusterIP 10.217.5.14 <none> 8080/TCP 4m38s
# get the route
oc get route
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
podroute-route podroute-route-podroute.apps-crc.testing podroute-service 8080 None
# should be 3 pod replicas
oc get pods
oc login -u kubeadmin -p KUBEADMIN_PASSWORD https://api.crc.testing:6443
oc new-project podroute
# Installs the custom resource definitions onto the cluster
make install
# Create the CR on cluster
oc apply -f - <<EOF
---
apiVersion: quay.io/v1alpha1
kind: Podroute
metadata:
crc start
INFO Adding crc-admin and crc-developer contexts to kubeconfig...
Started the OpenShift cluster.
The server is accessible via web console at:
https://console-openshift-console.apps-crc.testing
Log in as administrator:
Username: kubeadmin
Password: KUBEADMIN_PASSWORD
if err := routev1.AddToScheme(mgr.GetScheme()); err != nil {
setupLog.Error(err, "failed to add routev1 to scheme")
os.Exit(1)
}
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
routev1 "github.com/openshift/api/route/v1"
appsv1 "k8s.io/api/apps/v1"
// check for a route if it doesn't exist it creates one on cluster using the route created in podRouteRoute
func (r PodrouteReconciler) createRoute(cr *quayiov1alpha1.Podroute, podRouteRoute *routev1.Route) error {
// check for a route in the namespace
found := &routev1.Route{}
err := r.Client.Get(context.TODO(), types.NamespacedName{Name: podRouteRoute.Name, Namespace: cr.Namespace}, found)
if err != nil {
log.Log.Info("Creating Route")
err = r.Client.Create(context.TODO(), podRouteRoute)
if err != nil {
log.Log.Error(err, "Failed to create Route")