
// This file was autogenerated by go-to-protobuf. Do not edit it manually!

syntax = 'proto2';

package github.com.openshift.api.operator.v1alpha1;

import "github.com/openshift/api/config/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";

// Package-wide variables from generator "generated".
option go_package = "v1alpha1";

// DelegatedAuthentication allows authentication to be disabled.
message DelegatedAuthentication {
  // disabled indicates that authentication should be disabled.  By default it will use delegated authentication.
  optional bool disabled = 1;
}

// DelegatedAuthorization allows authorization to be disabled.
message DelegatedAuthorization {
  // disabled indicates that authorization should be disabled.  By default it will use delegated authorization.
  optional bool disabled = 1;
}

// GenerationHistory keeps track of the generation for a given resource so that decisions about forced updated can be made.
message GenerationHistory {
  // group is the group of the thing you're tracking
  optional string group = 1;

  // resource is the resource type of the thing you're tracking
  optional string resource = 2;

  // namespace is where the thing you're tracking is
  optional string namespace = 3;

  // name is the name of the thing you're tracking
  optional string name = 4;

  // lastGeneration is the last generation of the workload controller involved
  optional int64 lastGeneration = 5;
}

// GenericOperatorConfig provides information to configure an operator
message GenericOperatorConfig {
  // ServingInfo is the HTTP serving information for the controller's endpoints
  optional github.com.openshift.api.config.v1.HTTPServingInfo servingInfo = 1;

  // leaderElection provides information to elect a leader. Only override this if you have a specific need
  optional github.com.openshift.api.config.v1.LeaderElection leaderElection = 2;

  // authentication allows configuration of authentication for the endpoints
  optional DelegatedAuthentication authentication = 3;

  // authorization allows configuration of authentication for the endpoints
  optional DelegatedAuthorization authorization = 4;
}

// LoggingConfig holds information about configuring logging
message LoggingConfig {
  // level is passed to glog.
  optional int64 level = 1;

  // vmodule is passed to glog.
  optional string vmodule = 2;
}

// OperatorCondition is just the standard condition fields.
message OperatorCondition {
  optional string type = 1;

  optional string status = 2;

  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;

  optional string reason = 4;

  optional string message = 5;
}

// OperatorSpec contains common fields for an operator to need.  It is intended to be anonymous included
// inside of the Spec struct for you particular operator.
message OperatorSpec {
  // managementState indicates whether and how the operator should manage the component
  optional string managementState = 1;

  // imagePullSpec is the image to use for the component.
  optional string imagePullSpec = 2;

  // version is the desired state in major.minor.micro-patch.  Usually patch is ignored.
  optional string version = 3;

  // logging contains glog parameters for the component pods.  It's always a command line arg for the moment
  optional LoggingConfig logging = 4;
}

// OperatorStatus contains common fields for an operator to need.  It is intended to be anonymous included
// inside of the Status struct for you particular operator.
message OperatorStatus {
  // observedGeneration is the last generation change you've dealt with
  optional int64 observedGeneration = 1;

  // conditions is a list of conditions and their status
  repeated OperatorCondition conditions = 2;

  // state indicates what the operator has observed to be its current operational status.
  optional string state = 3;

  // taskSummary is a high level summary of what the controller is currently attempting to do.  It is high-level, human-readable
  // and not guaranteed in any way. (I needed this for debugging and realized it made a great summary).
  optional string taskSummary = 4;

  // currentVersionAvailability is availability information for the current version.  If it is unmanged or removed, this doesn't exist.
  optional VersionAvailablity currentVersionAvailability = 5;

  // targetVersionAvailability is availability information for the target version if we are migrating
  optional VersionAvailablity targetVersionAvailability = 6;
}

// VersionAvailablity gives information about the synchronization and operational status of a particular version of the component
message VersionAvailablity {
  // version is the level this availability applies to
  optional string version = 1;

  // updatedReplicas indicates how many replicas are at the desired state
  optional int32 updatedReplicas = 2;

  // readyReplicas indicates how many replicas are ready and at the desired state
  optional int32 readyReplicas = 3;

  // errors indicates what failures are associated with the operator trying to manage this version
  repeated string errors = 4;

  // generations allows an operator to track what the generation of "important" resources was the last time we updated them
  repeated GenerationHistory generations = 5;
}

