Skip to content

Commit 6a40ed1

Browse files
authored
Merge pull request kubernetes#77751 from baasbank/fix-lint-errors-staging/src/k8s.io
Fix lint errors staging/src/k8s.io
2 parents 746404f + 55d4586 commit 6a40ed1

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

hack/.golint_failures

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,8 @@ staging/src/k8s.io/sample-apiserver/pkg/admission/plugin/banflunder
592592
staging/src/k8s.io/sample-apiserver/pkg/admission/wardleinitializer
593593
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle
594594
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1
595-
staging/src/k8s.io/sample-apiserver/pkg/apiserver
596-
staging/src/k8s.io/sample-apiserver/pkg/cmd/server
597595
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer
598596
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
599-
staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller
600-
staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1
601597
test/e2e
602598
test/e2e/autoscaling
603599
test/e2e/chaosmonkey

staging/src/k8s.io/sample-apiserver/pkg/apiserver/apiserver.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ import (
3333
)
3434

3535
var (
36+
// Scheme defines methods for serializing and deserializing API objects.
3637
Scheme = runtime.NewScheme()
38+
// Codecs provides methods for retrieving codecs and serializers for specific
39+
// versions and content types.
3740
Codecs = serializer.NewCodecFactory(Scheme)
3841
)
3942

@@ -55,10 +58,12 @@ func init() {
5558
)
5659
}
5760

61+
// ExtraConfig holds custom apiserver config
5862
type ExtraConfig struct {
5963
// Place you custom config here.
6064
}
6165

66+
// Config defines the config for the apiserver
6267
type Config struct {
6368
GenericConfig *genericapiserver.RecommendedConfig
6469
ExtraConfig ExtraConfig
@@ -74,8 +79,8 @@ type completedConfig struct {
7479
ExtraConfig *ExtraConfig
7580
}
7681

82+
// CompletedConfig embeds a private pointer that cannot be instantiated outside of this package.
7783
type CompletedConfig struct {
78-
// Embed a private pointer that cannot be instantiated outside of this package.
7984
*completedConfig
8085
}
8186

staging/src/k8s.io/sample-apiserver/pkg/cmd/server/start.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import (
4141

4242
const defaultEtcdPathPrefix = "/registry/wardle.kubernetes.io"
4343

44+
// WardleServerOptions contains state for master/api server
4445
type WardleServerOptions struct {
4546
RecommendedOptions *genericoptions.RecommendedOptions
4647

@@ -49,6 +50,7 @@ type WardleServerOptions struct {
4950
StdErr io.Writer
5051
}
5152

53+
// NewWardleServerOptions returns a new WardleServerOptions
5254
func NewWardleServerOptions(out, errOut io.Writer) *WardleServerOptions {
5355
o := &WardleServerOptions{
5456
RecommendedOptions: genericoptions.NewRecommendedOptions(
@@ -92,12 +94,14 @@ func NewCommandStartWardleServer(defaults *WardleServerOptions, stopCh <-chan st
9294
return cmd
9395
}
9496

97+
// Validate validates WardleServerOptions
9598
func (o WardleServerOptions) Validate(args []string) error {
9699
errors := []error{}
97100
errors = append(errors, o.RecommendedOptions.Validate()...)
98101
return utilerrors.NewAggregate(errors)
99102
}
100103

104+
// Complete fills in fields required to have valid data
101105
func (o *WardleServerOptions) Complete() error {
102106
// register admission plugins
103107
banflunder.Register(o.RecommendedOptions.Admission.Plugins)
@@ -108,6 +112,7 @@ func (o *WardleServerOptions) Complete() error {
108112
return nil
109113
}
110114

115+
// Config returns config for the api server given WardleServerOptions
111116
func (o *WardleServerOptions) Config() (*apiserver.Config, error) {
112117
// TODO have a "real" external address
113118
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) {
138143
return config, nil
139144
}
140145

146+
// RunWardleServer starts a new WardleServer given WardleServerOptions
141147
func (o WardleServerOptions) RunWardleServer(stopCh <-chan struct{}) error {
142148
config, err := o.Config()
143149
if err != nil {

staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller/register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
package samplecontroller
1818

19+
// GroupName is the group name used in this package
1920
const (
2021
GroupName = "samplecontroller.k8s.io"
2122
)

staging/src/k8s.io/sample-controller/pkg/apis/samplecontroller/v1alpha1/register.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ func Resource(resource string) schema.GroupResource {
3838
}
3939

4040
var (
41+
// SchemeBuilder initializes a scheme builder
4142
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
42-
AddToScheme = SchemeBuilder.AddToScheme
43+
// AddToScheme is a global function that registers this API group & version to a scheme
44+
AddToScheme = SchemeBuilder.AddToScheme
4345
)
4446

4547
// Adds the list of known types to Scheme.

0 commit comments

Comments
 (0)