Skip to content

Instantly share code, notes, and snippets.

SaaS Advice

  1. Logs
    1. Logging Decisions
    2. Logging Stories
    3. Logging Negatives - hard to know if you're not finding it, or if the log entry doesn't exist
    4. Logging Storage
    5. Structured Logging
  2. Include a human readable "msg" which helps reading the flow of events - tells the story
# This was the basis of the individual examples that were written.
Feature: Monopoly Game
Scenario: Player Movement
Given player "A" on "The Angel Islington"
When the player rolls a 2 and 1
Then they land on "Pentonville Road"
Scenario: Passing through GO!
Given: player "B" on "Park Lane"
apiVersion: capi.gitops.solutions/v1alpha1
kind: ClusterBootstrapConfig
metadata:
name: clusterbootstrapconfig-sample
namespace: default
spec:
clusterSelector:
matchLabels:
weave.works/spike: upa
jobTemplates:
FROM alpine:3.12
RUN apk add --no-cache curl jq bash
CMD ["/bin/sh"]

Gated Deployments in Kubernetes

Getting to GitOps requires that the staff tasked with looking after business services are confident that changes that are deployed automatically meet the certain standards.

How do we build that confidence?

package yaml
import (
"sort"
"gopkg.in/yaml.v2"
sigsyaml "sigs.k8s.io/yaml"
)
type orderFunc func(a, b string) bool
apps:
- name: my-application
description: my-app
repository:
source: https://github.com/testing/testing.git
secret: my-named-secret
token: my-named-token:token
environments:
- name: dev
description: for all developers
package clock
import (
"reflect"
"testing"
"time"
)
func TestSeconds(t *testing.T) {
var tests = []struct {

Please ensure you have Go 1.8 installed on your machine.

If you're on Ubuntu this might help

 $ sudo add-apt-repository ppa:longsleep/golang-backports
 $ sudo apt-get update
 $ sudo apt-get install golang-go
from flask import Flask
from logging.handlers import SysLogHandler
# $ python hello.py
# * Restarting with stat
# * Debugger is active!
# --------------------------------------------------------------------------------
# INFO in hello [hello.py:9]:
# Getting / in the Hello flask app
# --------------------------------------------------------------------------------