syntax = "proto3";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "meta.proto";

package sensu.core.v2;

option go_package = "v2";
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.testgen_all) = true;

// A Mutator is a mutator specification.
message Mutator {
  option (gogoproto.face) = true;
  option (gogoproto.goproto_getters) = false;

  // Metadata contains the name, namespace, labels and annotations of the mutator
  ObjectMeta metadata = 1 [(gogoproto.jsontag) = "metadata,omitempty", (gogoproto.embed) = true, (gogoproto.nullable) = false];

  // Command is the command to be executed.
  string command = 2;

  // Timeout is the command execution timeout in seconds.
  uint32 timeout = 3 [(gogoproto.jsontag) = "timeout"];

  // Env is a list of environment variables to use with command execution
  repeated string env_vars = 4 [(gogoproto.jsontag) = "env_vars"];

  // RuntimeAssets are a list of assets required to execute a mutator.
  repeated string runtime_assets = 8 [(gogoproto.jsontag) = "runtime_assets"];
}
