Generate and format files
- Run hack/update-codegen.sh - Run hack/update-generated-device-plugin.sh - Run hack/update-generated-protobuf.sh - Run hack/update-generated-runtime.sh - Run hack/update-generated-swagger-docs.sh - Run hack/update-openapi-spec.sh - Run hack/update-gofmt.sh Signed-off-by: Davanum Srinivas <davanum@gmail.com> Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
This commit is contained in:
parent
a13e0b29d5
commit
7e94033a61
|
|
@ -60,6 +60,7 @@ type WantsDrainedNotification interface {
|
||||||
// WantsFeatureGate defines a function which passes the featureGates for inspection by an admission plugin.
|
// WantsFeatureGate defines a function which passes the featureGates for inspection by an admission plugin.
|
||||||
// Admission plugins should not hold a reference to the featureGates. Instead, they should query a particular one
|
// Admission plugins should not hold a reference to the featureGates. Instead, they should query a particular one
|
||||||
// and assign it to a simple bool in the admission plugin struct.
|
// and assign it to a simple bool in the admission plugin struct.
|
||||||
|
//
|
||||||
// func (a *admissionPlugin) InspectFeatureGates(features featuregate.FeatureGate){
|
// func (a *admissionPlugin) InspectFeatureGates(features featuregate.FeatureGate){
|
||||||
// a.myFeatureIsOn = features.Enabled("my-feature")
|
// a.myFeatureIsOn = features.Enabled("my-feature")
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,14 @@ limitations under the License.
|
||||||
// source: k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/example2/v1/generated.proto
|
// source: k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/example2/v1/generated.proto
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package v1 is a generated protocol buffer package.
|
Package v1 is a generated protocol buffer package.
|
||||||
|
|
||||||
|
It is generated from these files:
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/example2/v1/generated.proto
|
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/example2/v1/generated.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
|
|
||||||
ReplicaSet
|
ReplicaSet
|
||||||
ReplicaSetSpec
|
ReplicaSetSpec
|
||||||
ReplicaSetStatus
|
ReplicaSetStatus
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ var leadingDigits = regexp.MustCompile(`^(\d+)`)
|
||||||
|
|
||||||
// MajorMinor parses a numeric major/minor version from the provided version info.
|
// MajorMinor parses a numeric major/minor version from the provided version info.
|
||||||
// The minor version drops all characters after the first non-digit character:
|
// The minor version drops all characters after the first non-digit character:
|
||||||
|
//
|
||||||
// version.Info{Major:"1", Minor:"2+"} -> 1,2
|
// version.Info{Major:"1", Minor:"2+"} -> 1,2
|
||||||
// version.Info{Major:"1", Minor:"2.3-build4"} -> 1,2
|
// version.Info{Major:"1", Minor:"2.3-build4"} -> 1,2
|
||||||
func MajorMinor(v version.Info) (int, int, error) {
|
func MajorMinor(v version.Info) (int, int, error) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ func TestNamespaceContext(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TestUserContext validates that a userinfo can be get/set on a context object
|
// TestUserContext validates that a userinfo can be get/set on a context object
|
||||||
func TestUserContext(t *testing.T) {
|
func TestUserContext(t *testing.T) {
|
||||||
ctx := NewContext()
|
ctx := NewContext()
|
||||||
_, ok := UserFrom(ctx)
|
_, ok := UserFrom(ctx)
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,9 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
|
||||||
// | |
|
// | |
|
||||||
// ShutdownInitiated (shutdownInitiatedCh) |
|
// ShutdownInitiated (shutdownInitiatedCh) |
|
||||||
// | |
|
// | |
|
||||||
|
//
|
||||||
// (ShutdownDelayDuration) (PreShutdownHooks)
|
// (ShutdownDelayDuration) (PreShutdownHooks)
|
||||||
|
//
|
||||||
// | |
|
// | |
|
||||||
// AfterShutdownDelayDuration (delayedStopCh) PreShutdownHooksStopped (preShutdownHooksHasStoppedCh)
|
// AfterShutdownDelayDuration (delayedStopCh) PreShutdownHooksStopped (preShutdownHooksHasStoppedCh)
|
||||||
// | |
|
// | |
|
||||||
|
|
@ -437,7 +439,9 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
|
||||||
// |---------------------------------------------------------|
|
// |---------------------------------------------------------|
|
||||||
// | | | |
|
// | | | |
|
||||||
// [without [with | |
|
// [without [with | |
|
||||||
|
//
|
||||||
// ShutdownSendRetryAfter] ShutdownSendRetryAfter] | |
|
// ShutdownSendRetryAfter] ShutdownSendRetryAfter] | |
|
||||||
|
//
|
||||||
// | | | |
|
// | | | |
|
||||||
// | ---------------| |
|
// | ---------------| |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
@ -452,7 +456,6 @@ func (s *GenericAPIServer) PrepareRun() preparedGenericAPIServer {
|
||||||
// listenerStoppedCh
|
// listenerStoppedCh
|
||||||
// |
|
// |
|
||||||
// HTTPServerStoppedListening (httpServerStoppedListeningCh)
|
// HTTPServerStoppedListening (httpServerStoppedListeningCh)
|
||||||
//
|
|
||||||
func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
|
func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
|
||||||
delayedStopCh := s.lifecycleSignals.AfterShutdownDelayDuration
|
delayedStopCh := s.lifecycleSignals.AfterShutdownDelayDuration
|
||||||
shutdownInitiatedCh := s.lifecycleSignals.ShutdownInitiated
|
shutdownInitiatedCh := s.lifecycleSignals.ShutdownInitiated
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ func newSignalInterceptingTestStep() *signalInterceptingTestStep {
|
||||||
// <-stoppedCh
|
// <-stoppedCh
|
||||||
// |
|
// |
|
||||||
// return nil
|
// return nil
|
||||||
//
|
|
||||||
func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationDisabled(t *testing.T) {
|
func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationDisabled(t *testing.T) {
|
||||||
fakeAudit := &fakeAudit{}
|
fakeAudit := &fakeAudit{}
|
||||||
s := newGenericAPIServer(t, fakeAudit, false)
|
s := newGenericAPIServer(t, fakeAudit, false)
|
||||||
|
|
@ -335,9 +334,12 @@ func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationDisabled(t
|
||||||
|
|
||||||
// This test exercises the graceful termination scenario
|
// This test exercises the graceful termination scenario
|
||||||
// described in the following diagram
|
// described in the following diagram
|
||||||
|
//
|
||||||
// - every vertical line is an independent timeline
|
// - every vertical line is an independent timeline
|
||||||
|
//
|
||||||
// - the leftmost vertical line represents the go routine that
|
// - the leftmost vertical line represents the go routine that
|
||||||
// is executing GenericAPIServer.Run method
|
// is executing GenericAPIServer.Run method
|
||||||
|
//
|
||||||
// - (signal) indicates that the given lifecycle signal has been fired
|
// - (signal) indicates that the given lifecycle signal has been fired
|
||||||
//
|
//
|
||||||
// stopCh
|
// stopCh
|
||||||
|
|
@ -376,7 +378,6 @@ func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationDisabled(t
|
||||||
// <-stoppedCh
|
// <-stoppedCh
|
||||||
// |
|
// |
|
||||||
// return nil
|
// return nil
|
||||||
//
|
|
||||||
func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationEnabled(t *testing.T) {
|
func TestGracefulTerminationWithKeepListeningDuringGracefulTerminationEnabled(t *testing.T) {
|
||||||
fakeAudit := &fakeAudit{}
|
fakeAudit := &fakeAudit{}
|
||||||
s := newGenericAPIServer(t, fakeAudit, true)
|
s := newGenericAPIServer(t, fakeAudit, true)
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ func (d director) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
d.nonGoRestfulMux.ServeHTTP(w, req)
|
d.nonGoRestfulMux.ServeHTTP(w, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Unify with RecoverPanics?
|
// TODO: Unify with RecoverPanics?
|
||||||
func logStackOnRecover(s runtime.NegotiatedSerializer, panicReason interface{}, w http.ResponseWriter) {
|
func logStackOnRecover(s runtime.NegotiatedSerializer, panicReason interface{}, w http.ResponseWriter) {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
|
buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
// Package healthz implements basic http server health checking.
|
// Package healthz implements basic http server health checking.
|
||||||
// Usage:
|
// Usage:
|
||||||
|
//
|
||||||
// import "k8s.io/apiserver/pkg/server/healthz"
|
// import "k8s.io/apiserver/pkg/server/healthz"
|
||||||
// healthz.InstallHandler(mux)
|
// healthz.InstallHandler(mux)
|
||||||
package healthz // import "k8s.io/apiserver/pkg/server/healthz"
|
package healthz // import "k8s.io/apiserver/pkg/server/healthz"
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import (
|
||||||
// 2. conflicts between the different processes all trying to perform the same action
|
// 2. conflicts between the different processes all trying to perform the same action
|
||||||
// 3. partially complete work (API server crashes while running your hook)
|
// 3. partially complete work (API server crashes while running your hook)
|
||||||
// 4. API server access **BEFORE** your hook has completed
|
// 4. API server access **BEFORE** your hook has completed
|
||||||
|
//
|
||||||
// Think of it like a mini-controller that is super privileged and gets to run in-process
|
// Think of it like a mini-controller that is super privileged and gets to run in-process
|
||||||
// If you use this feature, tag @deads2k on github who has promised to review code for anyone's PostStartHook
|
// If you use this feature, tag @deads2k on github who has promised to review code for anyone's PostStartHook
|
||||||
// until it becomes easier to use.
|
// until it becomes easier to use.
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ type AdmissionOptions struct {
|
||||||
|
|
||||||
// NewAdmissionOptions creates a new instance of AdmissionOptions
|
// NewAdmissionOptions creates a new instance of AdmissionOptions
|
||||||
// Note:
|
// Note:
|
||||||
|
//
|
||||||
// In addition it calls RegisterAllAdmissionPlugins to register
|
// In addition it calls RegisterAllAdmissionPlugins to register
|
||||||
// all generic admission plugins.
|
// all generic admission plugins.
|
||||||
//
|
//
|
||||||
|
|
@ -115,6 +116,7 @@ func (a *AdmissionOptions) AddFlags(fs *pflag.FlagSet) {
|
||||||
// In case admission plugin names were not provided by a cluster-admin they will be prepared from the recommended/default values.
|
// In case admission plugin names were not provided by a cluster-admin they will be prepared from the recommended/default values.
|
||||||
// In addition the method lazily initializes a generic plugin that is appended to the list of pluginInitializers
|
// In addition the method lazily initializes a generic plugin that is appended to the list of pluginInitializers
|
||||||
// note this method uses:
|
// note this method uses:
|
||||||
|
//
|
||||||
// genericconfig.Authorizer
|
// genericconfig.Authorizer
|
||||||
func (a *AdmissionOptions) ApplyTo(
|
func (a *AdmissionOptions) ApplyTo(
|
||||||
c *server.Config,
|
c *server.Config,
|
||||||
|
|
@ -220,7 +222,7 @@ func (a *AdmissionOptions) enabledPluginNames() []string {
|
||||||
return orderedPlugins
|
return orderedPlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return names of plugins which are enabled by default
|
// Return names of plugins which are enabled by default
|
||||||
func (a *AdmissionOptions) defaultEnabledPluginNames() []string {
|
func (a *AdmissionOptions) defaultEnabledPluginNames() []string {
|
||||||
defaultOnPluginNames := []string{}
|
defaultOnPluginNames := []string{}
|
||||||
for _, pluginName := range a.RecommendedPluginOrder {
|
for _, pluginName := range a.RecommendedPluginOrder {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import (
|
||||||
// DelegatingAuthorizationOptions provides an easy way for composing API servers to delegate their authorization to
|
// DelegatingAuthorizationOptions provides an easy way for composing API servers to delegate their authorization to
|
||||||
// the root kube API server.
|
// the root kube API server.
|
||||||
// WARNING: never assume that every authenticated incoming request already does authorization.
|
// WARNING: never assume that every authenticated incoming request already does authorization.
|
||||||
|
//
|
||||||
// The aggregator in the kube API server does this today, but this behaviour is not
|
// The aggregator in the kube API server does this today, but this behaviour is not
|
||||||
// guaranteed in the future.
|
// guaranteed in the future.
|
||||||
type DelegatingAuthorizationOptions struct {
|
type DelegatingAuthorizationOptions struct {
|
||||||
|
|
|
||||||
|
|
@ -585,6 +585,7 @@ func (c *Cacher) Get(ctx context.Context, key string, opts storage.GetOptions, o
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTICE: Keep in sync with shouldListFromStorage function in
|
// NOTICE: Keep in sync with shouldListFromStorage function in
|
||||||
|
//
|
||||||
// staging/src/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go
|
// staging/src/k8s.io/apiserver/pkg/util/flowcontrol/request/list_work_estimator.go
|
||||||
func shouldDelegateList(opts storage.ListOptions) bool {
|
func shouldDelegateList(opts storage.ListOptions) bool {
|
||||||
resourceVersion := opts.ResourceVersion
|
resourceVersion := opts.ResourceVersion
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ const (
|
||||||
|
|
||||||
// timeBudget implements a budget of time that you can use and is
|
// timeBudget implements a budget of time that you can use and is
|
||||||
// periodically being refreshed. The pattern to use it is:
|
// periodically being refreshed. The pattern to use it is:
|
||||||
|
//
|
||||||
// budget := newTimeBudget(...)
|
// budget := newTimeBudget(...)
|
||||||
// ...
|
// ...
|
||||||
// timeout := budget.takeAvailable()
|
// timeout := budget.takeAvailable()
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ import (
|
||||||
// an interval as invalid iff we need to copy events from the
|
// an interval as invalid iff we need to copy events from the
|
||||||
// watchCache and we end up needing events that have already
|
// watchCache and we end up needing events that have already
|
||||||
// been popped off. This translates to the following condition:
|
// been popped off. This translates to the following condition:
|
||||||
|
//
|
||||||
// watchCacheInterval::startIndex >= watchCache::startIndex.
|
// watchCacheInterval::startIndex >= watchCache::startIndex.
|
||||||
|
//
|
||||||
// When this condition becomes false, the interval is no longer
|
// When this condition becomes false, the interval is no longer
|
||||||
// valid and should not be used to retrieve and serve elements
|
// valid and should not be used to retrieve and serve elements
|
||||||
// from the underlying source.
|
// from the underlying source.
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ func NewETCDLatencyTracker(delegate clientv3.KV) clientv3.KV {
|
||||||
// tracking function TrackStorageLatency is thread safe.
|
// tracking function TrackStorageLatency is thread safe.
|
||||||
//
|
//
|
||||||
// NOTE: Compact is an asynchronous process and is not associated with
|
// NOTE: Compact is an asynchronous process and is not associated with
|
||||||
|
//
|
||||||
// any request, so we will not be tracking its latency.
|
// any request, so we will not be tracking its latency.
|
||||||
type clientV3KVLatencyTracker struct {
|
type clientV3KVLatencyTracker struct {
|
||||||
clientv3.KV
|
clientv3.KV
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,16 @@ package testingcert
|
||||||
// https://github.com/coreos/etcd/tree/master/hack/tls-setup for more details.
|
// https://github.com/coreos/etcd/tree/master/hack/tls-setup for more details.
|
||||||
//
|
//
|
||||||
// ca-config.json:
|
// ca-config.json:
|
||||||
|
//
|
||||||
// expiry was changed from 1 year to 100 years (876000h)
|
// expiry was changed from 1 year to 100 years (876000h)
|
||||||
|
//
|
||||||
// ca-csr.json:
|
// ca-csr.json:
|
||||||
|
//
|
||||||
// ca expiry was set to 100 years (876000h) ("ca":{"expiry":"876000h"})
|
// ca expiry was set to 100 years (876000h) ("ca":{"expiry":"876000h"})
|
||||||
// key was changed from ecdsa,384 to rsa,2048
|
// key was changed from ecdsa,384 to rsa,2048
|
||||||
|
//
|
||||||
// req-csr.json:
|
// req-csr.json:
|
||||||
|
//
|
||||||
// key was changed from ecdsa,384 to rsa,2048
|
// key was changed from ecdsa,384 to rsa,2048
|
||||||
// hosts were changed to "localhost","127.0.0.1"
|
// hosts were changed to "localhost","127.0.0.1"
|
||||||
const CAFileContent = `
|
const CAFileContent = `
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,11 @@ func getAvailablePorts(count int) ([]int, error) {
|
||||||
|
|
||||||
// NewTestConfig returns a configuration for an embedded etcd server.
|
// NewTestConfig returns a configuration for an embedded etcd server.
|
||||||
// The configuration is based on embed.NewConfig(), with the following adjustments:
|
// The configuration is based on embed.NewConfig(), with the following adjustments:
|
||||||
// * sets UnsafeNoFsync = true to improve test performance (only reasonable in a test-only
|
// - sets UnsafeNoFsync = true to improve test performance (only reasonable in a test-only
|
||||||
// single-member server we never intend to restart or keep data from)
|
// single-member server we never intend to restart or keep data from)
|
||||||
// * uses free ports for client and peer listeners
|
// - uses free ports for client and peer listeners
|
||||||
// * cleans up the data directory on test termination
|
// - cleans up the data directory on test termination
|
||||||
// * silences server logs other than errors
|
// - silences server logs other than errors
|
||||||
func NewTestConfig(t *testing.T) *embed.Config {
|
func NewTestConfig(t *testing.T) *embed.Config {
|
||||||
cfg := embed.NewConfig()
|
cfg := embed.NewConfig()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ func findStatusCondition(conditions []v1alpha1.StorageVersionCondition,
|
||||||
// newCondition, LastTransitionTime is set to now if the new status differs from the old status
|
// newCondition, LastTransitionTime is set to now if the new status differs from the old status
|
||||||
// 2. if a condition of the specified type does not exist: LastTransitionTime is set to now() if unset,
|
// 2. if a condition of the specified type does not exist: LastTransitionTime is set to now() if unset,
|
||||||
// and newCondition is appended
|
// and newCondition is appended
|
||||||
|
//
|
||||||
// NOTE: forceTransition allows overwriting LastTransitionTime even when the status doesn't change.
|
// NOTE: forceTransition allows overwriting LastTransitionTime even when the status doesn't change.
|
||||||
func setStatusCondition(conditions *[]v1alpha1.StorageVersionCondition, newCondition v1alpha1.StorageVersionCondition,
|
func setStatusCondition(conditions *[]v1alpha1.StorageVersionCondition, newCondition v1alpha1.StorageVersionCondition,
|
||||||
forceTransition bool) {
|
forceTransition bool) {
|
||||||
|
|
|
||||||
|
|
@ -116,5 +116,4 @@ limitations under the License.
|
||||||
// queue’s virtual start time is advanced by G. When a request
|
// queue’s virtual start time is advanced by G. When a request
|
||||||
// finishes being served, and the actual service time was S, the
|
// finishes being served, and the actual service time was S, the
|
||||||
// queue’s virtual start time is decremented by G - S.
|
// queue’s virtual start time is decremented by G - S.
|
||||||
//
|
|
||||||
package queueset
|
package queueset
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ type waitGroupCounter struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// compile time assertion that waitGroupCounter meets requirements
|
// compile time assertion that waitGroupCounter meets requirements
|
||||||
|
//
|
||||||
// of GoRoutineCounter
|
// of GoRoutineCounter
|
||||||
var _ counter.GoRoutineCounter = (*waitGroupCounter)(nil)
|
var _ counter.GoRoutineCounter = (*waitGroupCounter)(nil)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,7 @@ func key(requestInfo *apirequest.RequestInfo) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTICE: Keep in sync with shouldDelegateList function in
|
// NOTICE: Keep in sync with shouldDelegateList function in
|
||||||
|
//
|
||||||
// staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go
|
// staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go
|
||||||
func shouldListFromStorage(query url.Values, opts *metav1.ListOptions) bool {
|
func shouldListFromStorage(query url.Values, opts *metav1.ListOptions) bool {
|
||||||
resourceVersion := opts.ResourceVersion
|
resourceVersion := opts.ResourceVersion
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ func (w *watchTracker) forgetWatch(identifier *watchIdentifier, index *indexValu
|
||||||
// GetInterestedWatchCount implements WatchTracker interface.
|
// GetInterestedWatchCount implements WatchTracker interface.
|
||||||
//
|
//
|
||||||
// TODO(wojtek-t): As of now, requestInfo for object creation (POST) doesn't
|
// TODO(wojtek-t): As of now, requestInfo for object creation (POST) doesn't
|
||||||
|
//
|
||||||
// contain the Name field set. Figure out if we can somehow get it for the
|
// contain the Name field set. Figure out if we can somehow get it for the
|
||||||
// more accurate cost estimation.
|
// more accurate cost estimation.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ func NewDefaultServiceResolver() ServiceResolver {
|
||||||
// note that the name, namespace, and port are required and by default all
|
// note that the name, namespace, and port are required and by default all
|
||||||
// created addresses use HTTPS scheme.
|
// created addresses use HTTPS scheme.
|
||||||
// for example:
|
// for example:
|
||||||
|
//
|
||||||
// name=ross namespace=andromeda resolves to https://ross.andromeda.svc:443
|
// name=ross namespace=andromeda resolves to https://ross.andromeda.svc:443
|
||||||
func (sr defaultServiceResolver) ResolveEndpoint(namespace, name string, port int32) (*url.URL, error) {
|
func (sr defaultServiceResolver) ResolveEndpoint(namespace, name string, port int32) (*url.URL, error) {
|
||||||
if len(name) == 0 || len(namespace) == 0 || port == 0 {
|
if len(name) == 0 || len(namespace) == 0 || port == 0 {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ import (
|
||||||
// WRITE []byte{0, 102, 111, 111, 10} # send "foo\n" on channel 0 (STDIN)
|
// WRITE []byte{0, 102, 111, 111, 10} # send "foo\n" on channel 0 (STDIN)
|
||||||
// READ []byte{1, 10} # receive "\n" on channel 1 (STDOUT)
|
// READ []byte{1, 10} # receive "\n" on channel 1 (STDOUT)
|
||||||
// CLOSE
|
// CLOSE
|
||||||
//
|
|
||||||
const ChannelWebSocketProtocol = "channel.k8s.io"
|
const ChannelWebSocketProtocol = "channel.k8s.io"
|
||||||
|
|
||||||
// The Websocket subprotocol "base64.channel.k8s.io" base64 encodes each message with a character
|
// The Websocket subprotocol "base64.channel.k8s.io" base64 encodes each message with a character
|
||||||
|
|
@ -60,7 +59,6 @@ const ChannelWebSocketProtocol = "channel.k8s.io"
|
||||||
// WRITE []byte{48, 90, 109, 57, 118, 67, 103, 111, 61} # send "foo\n" (base64: "Zm9vCgo=") on channel '0' (STDIN)
|
// WRITE []byte{48, 90, 109, 57, 118, 67, 103, 111, 61} # send "foo\n" (base64: "Zm9vCgo=") on channel '0' (STDIN)
|
||||||
// READ []byte{49, 67, 103, 61, 61} # receive "\n" (base64: "Cg==") on channel '1' (STDOUT)
|
// READ []byte{49, 67, 103, 61, 61} # receive "\n" (base64: "Cg==") on channel '1' (STDOUT)
|
||||||
// CLOSE
|
// CLOSE
|
||||||
//
|
|
||||||
const Base64ChannelWebSocketProtocol = "base64.channel.k8s.io"
|
const Base64ChannelWebSocketProtocol = "base64.channel.k8s.io"
|
||||||
|
|
||||||
type codecType int
|
type codecType int
|
||||||
|
|
|
||||||
|
|
@ -190,10 +190,10 @@ func (b *bufferedBackend) processIncomingEvents(stopCh <-chan struct{}) {
|
||||||
// The following things can cause collectEvents to stop and return the list
|
// The following things can cause collectEvents to stop and return the list
|
||||||
// of events:
|
// of events:
|
||||||
//
|
//
|
||||||
// * Maximum number of events for a batch.
|
// - Maximum number of events for a batch.
|
||||||
// * Timer has passed.
|
// - Timer has passed.
|
||||||
// * Buffer channel is closed and empty.
|
// - Buffer channel is closed and empty.
|
||||||
// * stopCh is closed.
|
// - stopCh is closed.
|
||||||
func (b *bufferedBackend) collectEvents(timer <-chan time.Time, stopCh <-chan struct{}) []*auditinternal.Event {
|
func (b *bufferedBackend) collectEvents(timer <-chan time.Time, stopCh <-chan struct{}) []*auditinternal.Event {
|
||||||
var events []*auditinternal.Event
|
var events []*auditinternal.Event
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ func (w *WebhookAuthorizer) Authorize(ctx context.Context, attr authorizer.Attri
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: need to finish the method to get the rules when using webhook mode
|
// TODO: need to finish the method to get the rules when using webhook mode
|
||||||
func (w *WebhookAuthorizer) RulesFor(user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) {
|
func (w *WebhookAuthorizer) RulesFor(user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) {
|
||||||
var (
|
var (
|
||||||
resourceRules []authorizer.ResourceRuleInfo
|
resourceRules []authorizer.ResourceRuleInfo
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue