Skip to content

Instantly share code, notes, and snippets.

FROM python:3
RUN wget https://gist.githubusercontent.com/patrick-east/24938c63f373e40c7b5832841605b1b2/raw/ca6370c91c255cec91ac9d21a7252f5c6ffdc35d/postr-server.py
RUN mv postr-server.py /bin/postr-server.py
RUN chmod +x /bin/postr-server.py
RUN pip install flask argparse
package library.kubernetes.admission.mutating
###########################################################################
# Implementation of the k8s admission control external webhook interface,
# combining validating and mutating admission controllers
###########################################################################
main = {
"apiVersion": "admission.k8s.io/v1beta1",
"kind": "AdmissionReview",
@patrick-east
patrick-east / out.txt
Created April 3, 2020 02:50
opa golang 1.13.7 -> 1.14.1
name old time/op new time/op delta
pkg:github.com/open-policy-agent/opa/ast goos:linux goarch:amd64
RewriteDynamics/1-4 329ns ± 4% 307ns ± 4% -6.81% (p=0.000 n=9+10)
RewriteDynamics/10-4 3.35µs ± 9% 3.02µs ± 1% -9.95% (p=0.000 n=10+10)
RewriteDynamics/100-4 34.1µs ± 3% 31.6µs ± 1% -7.34% (p=0.000 n=10+10)
RewriteDynamics/1000-4 357µs ± 6% 325µs ± 1% -8.82% (p=0.000 n=10+9)
RewriteDynamics/10000-4 4.60ms ± 5% 4.19ms ± 1% -8.94% (p=0.000 n=10+10)
RewriteDynamics/100000-4 73.1ms ± 4% 69.5ms ± 1% -4.93% (p=0.000 n=10+10)
ParseModuleRulesBase/1-4 5.66µs ± 2% 5.36µs ± 3% -5.34% (p=0.000 n=10+10)
ParseModuleRulesBase/10-4 39.1µs ±10% 35.3µs ± 3% -9.71% (p=0.000 n=10+10)
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Rego
file_extensions:
- rego
scope: source.rego
contexts:
main:
- include: comment
package main
import (
"context"
"fmt"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/rego"
)
@patrick-east
patrick-east / main.go
Created April 13, 2019 08:23
OPA Rego.Update() sample
package main
import (
"context"
"fmt"
"os"
"sort"
"github.com/open-policy-agent/opa/metrics"
### Pure Storage Individual Contributor License Agreement ("Agreement") via GitHub CLA Assistant
Thank you for your interest in Pure Storage Inc. (the "Company"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company and its users; it does not change your rights to use your own Contributions for any other purpose.
Please read this document carefully before accepting and keep a copy for your records. This agreement can be completed and accepted via GitHub CLA Assistant, OR by printing, signing, and mailing to:
Pure Storage, Attn: Legal OpenSource, 650 Castro St #200, Mountain View, CA 94041, U.S.A.
Full name: ______________________________________________________
(optional) Public name: ______________
commit a654e58c5c25cbf2baade37bebb2eda9388444c5
Author: Patrick East <patrick.east@purestorage.com>
Date: Fri Aug 19 18:50:04 2016 -0700
Kilo back-port of the iSCSI multipath enhancements
Inspired by https://github.com/openstack/cinder/commit/72273183871a244426f3237118a9002aa53063e7
diff --git a/cinder/tests/test_pure.py b/cinder/tests/test_pure.py
index 2157ce6..b97b6a3 100644
diff --git a/cinder/db/api.py b/cinder/db/api.py
index 73a48cf..5fc5566 100644
--- a/cinder/db/api.py
+++ b/cinder/db/api.py
@@ -1071,14 +1071,25 @@ def get_booleans_for_table(table_name):
###################
-def driver_initiator_data_update(context, initiator, namespace, updates):
- """Create DriverPrivateData from the values dictionary."""
#!/usr/bin/env python
# Copyright (c) 2015 Pure Storage, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0