Skip to content

Commit

Permalink
remove proto for non-proto-able resources
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Sep 25, 2018
1 parent cd2684f commit d264903
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 256 deletions.
114 changes: 57 additions & 57 deletions config/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,122 +8,122 @@ import (
// HTTPServingInfo holds configuration for serving HTTP
type HTTPServingInfo struct {
// ServingInfo is the HTTP serving information
ServingInfo `json:",inline" protobuf:"bytes,1,opt,name=servingInfo"`
ServingInfo `json:",inline"`
// MaxRequestsInFlight is the number of concurrent requests allowed to the server. If zero, no limit.
MaxRequestsInFlight int64 `json:"maxRequestsInFlight" protobuf:"varint,2,opt,name=maxRequestsInFlight"`
MaxRequestsInFlight int64 `json:"maxRequestsInFlight"`
// RequestTimeoutSeconds is the number of seconds before requests are timed out. The default is 60 minutes, if
// -1 there is no limit on requests.
RequestTimeoutSeconds int64 `json:"requestTimeoutSeconds" protobuf:"varint,3,opt,name=requestTimeoutSeconds"`
RequestTimeoutSeconds int64 `json:"requestTimeoutSeconds"`
}

// ServingInfo holds information about serving web pages
type ServingInfo struct {
// BindAddress is the ip:port to serve on
BindAddress string `json:"bindAddress" protobuf:"bytes,1,opt,name=bindAddress"`
BindAddress string `json:"bindAddress"`
// BindNetwork is the type of network to bind to - defaults to "tcp4", accepts "tcp",
// "tcp4", and "tcp6"
BindNetwork string `json:"bindNetwork" protobuf:"bytes,2,opt,name=bindNetwork"`
BindNetwork string `json:"bindNetwork"`
// CertInfo is the TLS cert info for serving secure traffic.
// this is anonymous so that we can inline it for serialization
CertInfo `json:",inline" protobuf:"bytes,3,opt,name=certInfo"`
CertInfo `json:",inline"`
// ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates
ClientCA string `json:"clientCA" protobuf:"bytes,4,opt,name=clientCA"`
ClientCA string `json:"clientCA"`
// NamedCertificates is a list of certificates to use to secure requests to specific hostnames
NamedCertificates []NamedCertificate `json:"namedCertificates" protobuf:"bytes,5,rep,name=namedCertificates"`
NamedCertificates []NamedCertificate `json:"namedCertificates"`
// MinTLSVersion is the minimum TLS version supported.
// Values must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants
MinTLSVersion string `json:"minTLSVersion,omitempty" protobuf:"bytes,6,opt,name=minTLSVersion"`
MinTLSVersion string `json:"minTLSVersion,omitempty"`
// CipherSuites contains an overridden list of ciphers for the server to support.
// Values must match cipher suite IDs from https://golang.org/pkg/crypto/tls/#pkg-constants
CipherSuites []string `json:"cipherSuites,omitempty" protobuf:"bytes,7,rep,name=cipherSuites"`
CipherSuites []string `json:"cipherSuites,omitempty"`
}

// CertInfo relates a certificate with a private key
type CertInfo struct {
// CertFile is a file containing a PEM-encoded certificate
CertFile string `json:"certFile" protobuf:"bytes,1,opt,name=certFile"`
CertFile string `json:"certFile"`
// KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile
KeyFile string `json:"keyFile" protobuf:"bytes,2,opt,name=keyFile"`
KeyFile string `json:"keyFile"`
}

// NamedCertificate specifies a certificate/key, and the names it should be served for
type NamedCertificate struct {
// Names is a list of DNS names this certificate should be used to secure
// A name can be a normal DNS name, or can contain leading wildcard segments.
Names []string `json:"names" protobuf:"bytes,1,rep,name=names"`
Names []string `json:"names"`
// CertInfo is the TLS cert info for serving secure traffic
CertInfo `json:",inline" protobuf:"bytes,2,opt,name=certInfo"`
CertInfo `json:",inline"`
}

// LeaderElection provides information to elect a leader
type LeaderElection struct {
// disable allows leader election to be suspended while allowing a fully defaulted "normal" startup case.
Disable bool `json:"disable,omitempty" protobuf:"varint,1,opt,name=disable"`
Disable bool `json:"disable,omitempty"`
// namespace indicates which namespace the resource is in
Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
Namespace string `json:"namespace,omitempty"`
// name indicates what name to use for the resource
Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`
Name string `json:"name,omitempty"`

// leaseDuration is the duration that non-leader candidates will wait
// after observing a leadership renewal until attempting to acquire
// leadership of a led but unrenewed leader slot. This is effectively the
// maximum duration that a leader can be stopped before it is replaced
// by another candidate. This is only applicable if leader election is
// enabled.
LeaseDuration metav1.Duration `json:"leaseDuration,omitempty" protobuf:"bytes,4,opt,name=leaseDuration"`
LeaseDuration metav1.Duration `json:"leaseDuration,omitempty"`
// renewDeadline is the interval between attempts by the acting master to
// renew a leadership slot before it stops leading. This must be less
// than or equal to the lease duration. This is only applicable if leader
// election is enabled.
RenewDeadline metav1.Duration `json:"renewDeadline,omitempty" protobuf:"bytes,5,opt,name=renewDeadline"`
RenewDeadline metav1.Duration `json:"renewDeadline,omitempty"`
// retryPeriod is the duration the clients should wait between attempting
// acquisition and renewal of a leadership. This is only applicable if
// leader election is enabled.
RetryPeriod metav1.Duration `json:"retryPeriod,omitempty" protobuf:"bytes,6,opt,name=retryPeriod"`
RetryPeriod metav1.Duration `json:"retryPeriod,omitempty"`
}

// StringSource allows specifying a string inline, or externally via env var or file.
// When it contains only a string value, it marshals to a simple JSON string.
type StringSource struct {
// StringSourceSpec specifies the string value, or external location
StringSourceSpec `json:",inline" protobuf:"bytes,1,opt,name=stringSourceSpec"`
StringSourceSpec `json:",inline"`
}

// StringSourceSpec specifies a string value, or external location
type StringSourceSpec struct {
// Value specifies the cleartext value, or an encrypted value if keyFile is specified.
Value string `json:"value" protobuf:"bytes,1,opt,name=value"`
Value string `json:"value"`

// Env specifies an envvar containing the cleartext value, or an encrypted value if the keyFile is specified.
Env string `json:"env" protobuf:"bytes,2,opt,name=env"`
Env string `json:"env"`

// File references a file containing the cleartext value, or an encrypted value if a keyFile is specified.
File string `json:"file" protobuf:"bytes,3,opt,name=file"`
File string `json:"file"`

// KeyFile references a file containing the key to use to decrypt the value.
KeyFile string `json:"keyFile" protobuf:"bytes,4,opt,name=keyFile"`
KeyFile string `json:"keyFile"`
}

// RemoteConnectionInfo holds information necessary for establishing a remote connection
type RemoteConnectionInfo struct {
// URL is the remote URL to connect to
URL string `json:"url" protobuf:"bytes,1,opt,name=url"`
URL string `json:"url"`
// CA is the CA for verifying TLS connections
CA string `json:"ca" protobuf:"bytes,2,opt,name=ca"`
CA string `json:"ca"`
// CertInfo is the TLS client cert information to present
// this is anonymous so that we can inline it for serialization
CertInfo `json:",inline" protobuf:"bytes,3,opt,name=certInfo"`
CertInfo `json:",inline"`
}

// AdmissionPluginConfig holds the necessary configuration options for admission plugins
type AdmissionPluginConfig struct {
// Location is the path to a configuration file that contains the plugin's
// configuration
Location string `json:"location" protobuf:"bytes,1,opt,name=location"`
Location string `json:"location"`

// Configuration is an embedded configuration object to be used as the plugin's
// configuration. If present, it will be used instead of the path to the configuration file.
Configuration runtime.RawExtension `json:"configuration" protobuf:"bytes,2,opt,name=configuration"`
Configuration runtime.RawExtension `json:"configuration"`
}

type LogFormatType string
Expand All @@ -150,89 +150,89 @@ const (
type AuditConfig struct {
// If this flag is set, audit log will be printed in the logs.
// The logs contains, method, user and a requested URL.
Enabled bool `json:"enabled" protobuf:"varint,1,opt,name=enabled"`
Enabled bool `json:"enabled"`
// All requests coming to the apiserver will be logged to this file.
AuditFilePath string `json:"auditFilePath" protobuf:"bytes,2,opt,name=auditFilePath"`
AuditFilePath string `json:"auditFilePath"`
// Maximum number of days to retain old log files based on the timestamp encoded in their filename.
MaximumFileRetentionDays int32 `json:"maximumFileRetentionDays" protobuf:"varint,3,opt,name=maximumFileRetentionDays"`
MaximumFileRetentionDays int32 `json:"maximumFileRetentionDays"`
// Maximum number of old log files to retain.
MaximumRetainedFiles int32 `json:"maximumRetainedFiles" protobuf:"varint,4,opt,name=maximumRetainedFiles"`
MaximumRetainedFiles int32 `json:"maximumRetainedFiles"`
// Maximum size in megabytes of the log file before it gets rotated. Defaults to 100MB.
MaximumFileSizeMegabytes int32 `json:"maximumFileSizeMegabytes" protobuf:"varint,5,opt,name=maximumFileSizeMegabytes"`
MaximumFileSizeMegabytes int32 `json:"maximumFileSizeMegabytes"`

// PolicyFile is a path to the file that defines the audit policy configuration.
PolicyFile string `json:"policyFile" protobuf:"bytes,6,opt,name=policyFile"`
PolicyFile string `json:"policyFile"`
// PolicyConfiguration is an embedded policy configuration object to be used
// as the audit policy configuration. If present, it will be used instead of
// the path to the policy file.
PolicyConfiguration runtime.RawExtension `json:"policyConfiguration" protobuf:"bytes,7,opt,name=policyConfiguration"`
PolicyConfiguration runtime.RawExtension `json:"policyConfiguration"`

// Format of saved audits (legacy or json).
LogFormat LogFormatType `json:"logFormat" protobuf:"bytes,8,opt,name=logFormat,casttype=LogFormatType"`
LogFormat LogFormatType `json:"logFormat"`

// Path to a .kubeconfig formatted file that defines the audit webhook configuration.
WebHookKubeConfig string `json:"webHookKubeConfig" protobuf:"bytes,9,opt,name=webHookKubeConfig"`
WebHookKubeConfig string `json:"webHookKubeConfig"`
// Strategy for sending audit events (block or batch).
WebHookMode WebHookModeType `json:"webHookMode" protobuf:"bytes,10,opt,name=webHookMode,casttype=WebHookModeType"`
WebHookMode WebHookModeType `json:"webHookMode"`
}

// EtcdConnectionInfo holds information necessary for connecting to an etcd server
type EtcdConnectionInfo struct {
// URLs are the URLs for etcd
URLs []string `json:"urls" protobuf:"bytes,1,rep,name=urls"`
URLs []string `json:"urls"`
// CA is a file containing trusted roots for the etcd server certificates
CA string `json:"ca" protobuf:"bytes,2,opt,name=ca"`
CA string `json:"ca"`
// CertInfo is the TLS client cert information for securing communication to etcd
// this is anonymous so that we can inline it for serialization
CertInfo `json:",inline" protobuf:"bytes,3,opt,name=certInfo"`
CertInfo `json:",inline"`
}

type EtcdStorageConfig struct {
EtcdConnectionInfo `json:",inline" protobuf:"bytes,1,opt,name=etcdConnectionInfo"`
EtcdConnectionInfo `json:",inline"`

// StoragePrefix is the path within etcd that the OpenShift resources will
// be rooted under. This value, if changed, will mean existing objects in etcd will
// no longer be located.
StoragePrefix string `json:"storagePrefix" protobuf:"bytes,2,opt,name=storagePrefix"`
StoragePrefix string `json:"storagePrefix"`
}

// GenericAPIServerConfig is an inline-able struct for aggregated apiservers that need to store data in etcd
type GenericAPIServerConfig struct {
// ServingInfo describes how to start serving
ServingInfo HTTPServingInfo `json:"servingInfo" protobuf:"bytes,1,opt,name=servingInfo"`
ServingInfo HTTPServingInfo `json:"servingInfo"`

// CORSAllowedOrigins
CORSAllowedOrigins []string `json:"corsAllowedOrigins" protobuf:"bytes,2,rep,name=corsAllowedOrigins"`
CORSAllowedOrigins []string `json:"corsAllowedOrigins"`

// AuditConfig describes how to configure audit information
AuditConfig AuditConfig `json:"auditConfig" protobuf:"bytes,3,opt,name=auditConfig"`
AuditConfig AuditConfig `json:"auditConfig"`

// StorageConfig contains information about how to use
StorageConfig EtcdStorageConfig `json:"storageConfig" protobuf:"bytes,4,opt,name=storageConfig"`
StorageConfig EtcdStorageConfig `json:"storageConfig"`

AdmissionPluginConfig map[string]AdmissionPluginConfig `json:"admissionPluginConfig" protobuf:"bytes,5,rep,name=admissionPluginConfig"`
AdmissionPluginConfig map[string]AdmissionPluginConfig `json:"admissionPluginConfig"`

KubeClientConfig KubeClientConfig `json:"kubeClientConfig" protobuf:"bytes,6,opt,name=kubeClientConfig,json=kubeClientConfig"`
KubeClientConfig KubeClientConfig `json:"kubeClientConfig"`
}

type KubeClientConfig struct {
// kubeConfig is a .kubeconfig filename for going to the owning kube-apiserver. Empty uses an in-cluster-config
KubeConfig string `json:"kubeConfig" protobuf:"bytes,1,opt,name=kubeConfig"`
KubeConfig string `json:"kubeConfig"`

// connectionOverrides specifies client overrides for system components to loop back to this master.
ConnectionOverrides ClientConnectionOverrides `json:"connectionOverrides" protobuf:"bytes,2,opt,name=connectionOverrides"`
ConnectionOverrides ClientConnectionOverrides `json:"connectionOverrides"`
}

type ClientConnectionOverrides struct {
// acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the
// default value of 'application/json'. This field will control all connections to the server used by a particular
// client.
AcceptContentTypes string `json:"acceptContentTypes" protobuf:"bytes,1,opt,name=acceptContentTypes"`
AcceptContentTypes string `json:"acceptContentTypes"`
// contentType is the content type used when sending data to the server from this client.
ContentType string `json:"contentType" protobuf:"bytes,2,opt,name=contentType"`
ContentType string `json:"contentType"`

// qps controls the number of queries per second allowed for this connection.
QPS float32 `json:"qps" protobuf:"fixed32,3,opt,name=qps"`
QPS float32 `json:"qps"`
// burst allows extra queries to accumulate when a client is exceeding its rate.
Burst int32 `json:"burst" protobuf:"varint,4,opt,name=burst"`
Burst int32 `json:"burst"`
}
11 changes: 3 additions & 8 deletions hack/lib/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ authorization/v1 \
build/v1 \
config/v1 \
image/v1 \
osin/v1 \
kubecontrolplane/v1 \
legacyconfig/v1 \
network/v1 \
oauth/v1 \
openshiftcontrolplane/v1 \
operator/v1alpha1 \
project/v1 \
quota/v1 \
Expand All @@ -33,19 +34,13 @@ API_PACKAGES="\
github.com/openshift/api/apps/v1,\
github.com/openshift/api/authorization/v1,\
github.com/openshift/api/build/v1,\
github.com/openshift/api/config/v1,\
github.com/openshift/api/image/v1,\
github.com/openshift/api/osin/v1,\
github.com/openshift/api/kubecontrolplane/v1,\
github.com/openshift/api/network/v1,\
github.com/openshift/api/oauth/v1,\
github.com/openshift/api/operator/v1alpha1,\
github.com/openshift/api/project/v1,\
github.com/openshift/api/quota/v1,\
github.com/openshift/api/route/v1,\
github.com/openshift/api/security/v1,\
github.com/openshift/api/servicecertsigner/v1alpha1,\
github.com/openshift/api/template/v1,\
github.com/openshift/api/user/v1,\
github.com/openshift/api/webconsole/v1\
github.com/openshift/api/user/v1\
"
Loading

0 comments on commit d264903

Please sign in to comment.