This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 + "!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| package com.example; | |
| option java_multiple_files = true; | |
| service Greeter { | |
| rpc SayHello (HelloRequest) returns (HelloReply) {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: chainsaw.kyverno.io/v1alpha1 | |
| kind: Test | |
| metadata: | |
| name: namespace | |
| spec: | |
| namespace: default | |
| steps: | |
| - try: | |
| - apply: | |
| file: resources.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: chainsaw.kyverno.io/v1alpha1 | |
| kind: Test | |
| metadata: | |
| name: pod-without-team-label | |
| spec: | |
| steps: | |
| - try: | |
| - apply: | |
| file: resources.yaml | |
| - assert: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: chainsaw.kyverno.io/v1alpha1 | |
| kind: Test | |
| metadata: | |
| name: pod-without-team-label | |
| spec: | |
| steps: | |
| - try: | |
| - apply: | |
| file: resources.yaml | |
| - assert: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| labels: | |
| environment: prod | |
| name: test | |
| spec: | |
| containers: | |
| - name: ubuntu | |
| image: ubuntu:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: kyverno.io/v1 | |
| kind: ClusterPolicy | |
| metadata: | |
| name: sync-configmaps | |
| spec: | |
| rules: | |
| - name: sync-configmaps | |
| match: | |
| any: | |
| - resources: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |