mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #77751 from baasbank/fix-lint-errors-staging/src/k8s.io
Fix lint errors staging/src/k8s.io
This commit is contained in:
commit
6a40ed1005
@ -592,12 +592,8 @@ staging/src/k8s.io/sample-apiserver/pkg/admission/plugin/banflunder
|
|||||||
staging/src/k8s.io/sample-apiserver/pkg/admission/wardleinitializer
|
staging/src/k8s.io/sample-apiserver/pkg/admission/wardleinitializer
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle
|
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1
|
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/apiserver
|
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/cmd/server
|
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer
|
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer
|
||||||
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
|
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
|
||||||
staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller
|
|
||||||
staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1
|
|
||||||
test/e2e
|
test/e2e
|
||||||
test/e2e/autoscaling
|
test/e2e/autoscaling
|
||||||
test/e2e/chaosmonkey
|
test/e2e/chaosmonkey
|
||||||
|
@ -33,7 +33,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// Scheme defines methods for serializing and deserializing API objects.
|
||||||
Scheme = runtime.NewScheme()
|
Scheme = runtime.NewScheme()
|
||||||
|
// Codecs provides methods for retrieving codecs and serializers for specific
|
||||||
|
// versions and content types.
|
||||||
Codecs = serializer.NewCodecFactory(Scheme)
|
Codecs = serializer.NewCodecFactory(Scheme)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -55,10 +58,12 @@ func init() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExtraConfig holds custom apiserver config
|
||||||
type ExtraConfig struct {
|
type ExtraConfig struct {
|
||||||
// Place you custom config here.
|
// Place you custom config here.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Config defines the config for the apiserver
|
||||||
type Config struct {
|
type Config struct {
|
||||||
GenericConfig *genericapiserver.RecommendedConfig
|
GenericConfig *genericapiserver.RecommendedConfig
|
||||||
ExtraConfig ExtraConfig
|
ExtraConfig ExtraConfig
|
||||||
@ -74,8 +79,8 @@ type completedConfig struct {
|
|||||||
ExtraConfig *ExtraConfig
|
ExtraConfig *ExtraConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CompletedConfig embeds a private pointer that cannot be instantiated outside of this package.
|
||||||
type CompletedConfig struct {
|
type CompletedConfig struct {
|
||||||
// Embed a private pointer that cannot be instantiated outside of this package.
|
|
||||||
*completedConfig
|
*completedConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ import (
|
|||||||
|
|
||||||
const defaultEtcdPathPrefix = "/registry/wardle.kubernetes.io"
|
const defaultEtcdPathPrefix = "/registry/wardle.kubernetes.io"
|
||||||
|
|
||||||
|
// WardleServerOptions contains state for master/api server
|
||||||
type WardleServerOptions struct {
|
type WardleServerOptions struct {
|
||||||
RecommendedOptions *genericoptions.RecommendedOptions
|
RecommendedOptions *genericoptions.RecommendedOptions
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ type WardleServerOptions struct {
|
|||||||
StdErr io.Writer
|
StdErr io.Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewWardleServerOptions returns a new WardleServerOptions
|
||||||
func NewWardleServerOptions(out, errOut io.Writer) *WardleServerOptions {
|
func NewWardleServerOptions(out, errOut io.Writer) *WardleServerOptions {
|
||||||
o := &WardleServerOptions{
|
o := &WardleServerOptions{
|
||||||
RecommendedOptions: genericoptions.NewRecommendedOptions(
|
RecommendedOptions: genericoptions.NewRecommendedOptions(
|
||||||
@ -92,12 +94,14 @@ func NewCommandStartWardleServer(defaults *WardleServerOptions, stopCh <-chan st
|
|||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate validates WardleServerOptions
|
||||||
func (o WardleServerOptions) Validate(args []string) error {
|
func (o WardleServerOptions) Validate(args []string) error {
|
||||||
errors := []error{}
|
errors := []error{}
|
||||||
errors = append(errors, o.RecommendedOptions.Validate()...)
|
errors = append(errors, o.RecommendedOptions.Validate()...)
|
||||||
return utilerrors.NewAggregate(errors)
|
return utilerrors.NewAggregate(errors)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Complete fills in fields required to have valid data
|
||||||
func (o *WardleServerOptions) Complete() error {
|
func (o *WardleServerOptions) Complete() error {
|
||||||
// register admission plugins
|
// register admission plugins
|
||||||
banflunder.Register(o.RecommendedOptions.Admission.Plugins)
|
banflunder.Register(o.RecommendedOptions.Admission.Plugins)
|
||||||
@ -108,6 +112,7 @@ func (o *WardleServerOptions) Complete() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Config returns config for the api server given WardleServerOptions
|
||||||
func (o *WardleServerOptions) Config() (*apiserver.Config, error) {
|
func (o *WardleServerOptions) Config() (*apiserver.Config, error) {
|
||||||
// TODO have a "real" external address
|
// TODO have a "real" external address
|
||||||
if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil {
|
if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil {
|
||||||
@ -138,6 +143,7 @@ func (o *WardleServerOptions) Config() (*apiserver.Config, error) {
|
|||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RunWardleServer starts a new WardleServer given WardleServerOptions
|
||||||
func (o WardleServerOptions) RunWardleServer(stopCh <-chan struct{}) error {
|
func (o WardleServerOptions) RunWardleServer(stopCh <-chan struct{}) error {
|
||||||
config, err := o.Config()
|
config, err := o.Config()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||||||
|
|
||||||
package samplecontroller
|
package samplecontroller
|
||||||
|
|
||||||
|
// GroupName is the group name used in this package
|
||||||
const (
|
const (
|
||||||
GroupName = "samplecontroller.k8s.io"
|
GroupName = "samplecontroller.k8s.io"
|
||||||
)
|
)
|
||||||
|
@ -38,8 +38,10 @@ func Resource(resource string) schema.GroupResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// SchemeBuilder initializes a scheme builder
|
||||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||||
AddToScheme = SchemeBuilder.AddToScheme
|
// AddToScheme is a global function that registers this API group & version to a scheme
|
||||||
|
AddToScheme = SchemeBuilder.AddToScheme
|
||||||
)
|
)
|
||||||
|
|
||||||
// Adds the list of known types to Scheme.
|
// Adds the list of known types to Scheme.
|
||||||
|
Loading…
Reference in New Issue
Block a user