// Copyright 2017 Istio Authors
//
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// THIS FILE IS AUTOMATICALLY GENERATED.

syntax = "proto3";


// The `kubernetes` template holds data that controls the production of Kubernetes-specific
// attributes.
//
// The `kubernetes` template represents data used to generate kubernetes-derived attributes.
// 
// The values provided controls the manner in which the kubernetesenv adapter discovers and
// generates values related to pod information.
// 
// Example config:
// ```yaml
// apiVersion: "config.istio.io/v1alpha2"
// kind: kubernetes
// metadata:
//   name: attributes
//   namespace: istio-system
// spec:
//   # Pass the required attribute data to the adapter
//   source_uid: source.uid | ""
//   source_ip: source.ip | ip("0.0.0.0") # default to unspecified ip addr
//   destination_uid: destination.uid | ""
//   destination_ip: destination.ip | ip("0.0.0.0") # default to unspecified ip addr
//   attribute_bindings:
//     # Fill the new attributes from the adapter produced output.
//     # $out refers to an instance of OutputTemplate message
//     source.ip: $out.source_pod_ip
//     source.labels: $out.source_labels
//     source.namespace: $out.source_namespace
//     source.service: $out.source_service
//     source.serviceAccount: $out.source_service_account_name
//     destination.ip: $out.destination_pod_ip
//     destination.labels: $out.destination_labels
//     destination.namespace: $out.destination_mamespace
//     destination.service: $out.destination_service
//     destination.serviceAccount: $out.destination_service_account_name
// ```
package adapter.template.kubernetes;


import "gogoproto/gogo.proto";
import "mixer/adapter/model/v1beta1/extensions.proto";



option (istio.mixer.adapter.model.v1beta1.template_variety) = TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR;
option (istio.mixer.adapter.model.v1beta1.template_name) = "kubernetes";

option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = false;
option (gogoproto.gostring_all) = false;


// Represents instance configuration schema for 'kubernetes' template.
message InstanceParam {
    
    // Source pod's uid. Must be of the form: "kubernetes://pod.namespace"
    string source_uid = 1;
    
    // Source pod's ip.
    string source_ip = 2;
    
    // Destination pod's uid. Must be of the form: "kubernetes://pod.namespace"
    string destination_uid = 3;
    
    // Destination pod's ip.
    string destination_ip = 4;
    
    // Origin pod's uid. Must be of the form: "kubernetes://pod.namespace"
    string origin_uid = 5;
    
    // Origin pod's ip.
    string origin_ip = 6;
    // Attribute names to expression mapping. These expressions can use the fields from the output object
    // returned by the attribute producing adapters using $out.<fieldName> notation. For example:
    // source.ip : $out.source_pod_ip
    // In the above example, source.ip attribute will be added to the existing attribute list and its value will be set to
    // the value of source_pod_ip field of the output returned by the adapter.
    map<string, string> attribute_bindings = 72295728;
    
}

