Skip to content

Instantly share code, notes, and snippets.

View larkintuckerllc's full-sized avatar

John Tucker larkintuckerllc

View GitHub Profile
package com.example;
import io.grpc.Server;
import io.grpc.ServerBuilder;
import java.util.concurrent.TimeUnit;
public class Main {
public static void main(String[] args) throws Exception {
package com.example;
import io.grpc.stub.StreamObserver;
public class GreeterImpl extends GreeterGrpc.GreeterImplBase {
@Override
public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
String name = request.getName();
HelloReply reply = HelloReply.newBuilder()
.setMessage("Hello, " + name + "!")
syntax = "proto3";
package com.example;
option java_multiple_files = true;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: namespace
spec:
namespace: default
steps:
- try:
- apply:
file: resources.yaml
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: pod-without-team-label
spec:
steps:
- try:
- apply:
file: resources.yaml
- assert:
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: pod-without-team-label
spec:
steps:
- try:
- apply:
file: resources.yaml
- assert:
apiVersion: v1
kind: Pod
metadata:
labels:
environment: prod
name: test
spec:
containers:
- name: ubuntu
image: ubuntu:latest
apiVersion: cli.kyverno.io/v1alpha1
kind: Test
metadata:
name: sync-configmaps
policies:
- sync-configmaps-clusterpolicy.yaml
resources:
- hello-world-namespace.yaml
results:
- policy: sync-configmaps
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: sync-configmaps
spec:
rules:
- name: sync-configmaps
match:
any:
- resources:
apiVersion: cli.kyverno.io/v1alpha1
kind: Test
metadata:
name: add-labels
policies:
- add-labels-clusterpolicy.yaml
resources:
- test-pod.yaml
- test-labeled-pod.yaml
- test-labeled-team-pod.yaml