Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1b234658
Unverified
Commit
1b234658
authored
Aug 09, 2018
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove defaulting from shared ComponentConfig types
parent
a224e53d
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
102 deletions
+29
-102
import-restrictions.yaml
hack/import-restrictions.yaml
+1
-0
BUILD
...ng/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD
+0
-1
defaults.go
.../k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go
+10
-9
doc.go
...g/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go
+0
-1
register.go
.../k8s.io/apimachinery/pkg/apis/config/v1alpha1/register.go
+0
-8
zz_generated.defaults.go
...chinery/pkg/apis/config/v1alpha1/zz_generated.defaults.go
+0
-32
Godeps.json
staging/src/k8s.io/apiserver/Godeps/Godeps.json
+4
-0
BUILD
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/BUILD
+1
-1
defaults.go
...src/k8s.io/apiserver/pkg/apis/config/v1alpha1/defaults.go
+12
-8
doc.go
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/doc.go
+1
-2
register.go
...src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go
+0
-8
zz_generated.defaults.go
...iserver/pkg/apis/config/v1alpha1/zz_generated.defaults.go
+0
-32
No files found.
hack/import-restrictions.yaml
View file @
1b234658
...
...
@@ -80,6 +80,7 @@
-
k8s.io/apiserver
-
k8s.io/client-go
-
k8s.io/kube-openapi
-
k8s.io/utils
-
baseImportPath
:
"
./vendor/k8s.io/metrics/"
allowedImports
:
...
...
staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/BUILD
View file @
1b234658
...
...
@@ -9,7 +9,6 @@ go_library(
"types.go",
"zz_generated.conversion.go",
"zz_generated.deepcopy.go",
"zz_generated.defaults.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/config/v1alpha1",
importpath = "k8s.io/apimachinery/pkg/apis/config/v1alpha1",
...
...
staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/defaults.go
View file @
1b234658
...
...
@@ -16,15 +16,16 @@ limitations under the License.
package
v1alpha1
import
(
kruntime
"k8s.io/apimachinery/pkg/runtime"
)
func
addDefaultingFuncs
(
scheme
*
kruntime
.
Scheme
)
error
{
return
RegisterDefaults
(
scheme
)
}
func
SetDefaults_ClientConnectionConfiguration
(
obj
*
ClientConnectionConfiguration
)
{
// RecommendedDefaultClientConnectionConfiguration defaults a pointer to a
// ClientConnectionConfiguration struct. This will set the recommended default
// values, but they may be subject to change between API versions. This function
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
// function to allow consumers of this type to set whatever defaults for their
// embedded configs. Forcing consumers to use these defaults would be problematic
// as defaulting in the scheme is done as part of the conversion, and there would
// be no easy way to opt-out. Instead, if you want to use this defaulting method
// run it in your wrapper struct of this type in its `SetDefaults_` method.
func
RecommendedDefaultClientConnectionConfiguration
(
obj
*
ClientConnectionConfiguration
)
{
if
len
(
obj
.
ContentType
)
==
0
{
obj
.
ContentType
=
"application/vnd.kubernetes.protobuf"
}
...
...
staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/doc.go
View file @
1b234658
...
...
@@ -16,6 +16,5 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config
// +k8s:defaulter-gen=TypeMeta
package
v1alpha1
// import "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/register.go
View file @
1b234658
...
...
@@ -21,15 +21,7 @@ import (
)
var
(
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder
runtime
.
SchemeBuilder
localSchemeBuilder
=
&
SchemeBuilder
AddToScheme
=
localSchemeBuilder
.
AddToScheme
)
func
init
()
{
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder
.
Register
(
addDefaultingFuncs
)
}
staging/src/k8s.io/apimachinery/pkg/apis/config/v1alpha1/zz_generated.defaults.go
deleted
100644 → 0
View file @
a224e53d
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by defaulter-gen. DO NOT EDIT.
package
v1alpha1
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func
RegisterDefaults
(
scheme
*
runtime
.
Scheme
)
error
{
return
nil
}
staging/src/k8s.io/apiserver/Godeps/Godeps.json
View file @
1b234658
...
...
@@ -1901,6 +1901,10 @@
{
"ImportPath"
:
"k8s.io/client-go/util/flowcontrol"
,
"Rev"
:
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
{
"ImportPath"
:
"k8s.io/utils/pointer"
,
"Rev"
:
"66066c83e385e385ccc3c964b44fd7dcd413d0ed"
}
]
}
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/BUILD
View file @
1b234658
...
...
@@ -9,7 +9,6 @@ go_library(
"types.go",
"zz_generated.conversion.go",
"zz_generated.deepcopy.go",
"zz_generated.defaults.go",
],
importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/apis/config/v1alpha1",
importpath = "k8s.io/apiserver/pkg/apis/config/v1alpha1",
...
...
@@ -19,6 +18,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/apis/config:go_default_library",
"//vendor/k8s.io/utils/pointer:go_default_library",
],
)
...
...
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/defaults.go
View file @
1b234658
...
...
@@ -20,15 +20,19 @@ import (
"time"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime
"k8s.io/apimachinery/pkg/runtime
"
utilpointer
"k8s.io/utils/pointer
"
)
func
addDefaultingFuncs
(
scheme
*
kruntime
.
Scheme
)
error
{
return
RegisterDefaults
(
scheme
)
}
func
SetDefaults_LeaderElectionConfiguration
(
obj
*
LeaderElectionConfiguration
)
{
booltrue
:=
true
// RecommendedDefaultLeaderElectionConfiguration defaults a pointer to a
// LeaderElectionConfiguration struct. This will set the recommended default
// values, but they may be subject to change between API versions. This function
// is intentionally not registered in the scheme as a "normal" `SetDefaults_Foo`
// function to allow consumers of this type to set whatever defaults for their
// embedded configs. Forcing consumers to use these defaults would be problematic
// as defaulting in the scheme is done as part of the conversion, and there would
// be no easy way to opt-out. Instead, if you want to use this defaulting method
// run it in your wrapper struct of this type in its `SetDefaults_` method.
func
RecommendedDefaultLeaderElectionConfiguration
(
obj
*
LeaderElectionConfiguration
)
{
zero
:=
metav1
.
Duration
{}
if
obj
.
LeaseDuration
==
zero
{
obj
.
LeaseDuration
=
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
}
...
...
@@ -43,6 +47,6 @@ func SetDefaults_LeaderElectionConfiguration(obj *LeaderElectionConfiguration) {
obj
.
ResourceLock
=
EndpointsResourceLock
}
if
obj
.
LeaderElect
==
nil
{
obj
.
LeaderElect
=
&
booltrue
obj
.
LeaderElect
=
utilpointer
.
BoolPtr
(
true
)
}
}
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/doc.go
View file @
1b234658
...
...
@@ -16,6 +16,5 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config
// +k8s:defaulter-gen=TypeMeta
package
v1alpha1
package
v1alpha1
// import "k8s.io/apiserver/pkg/apis/config/v1alpha1"
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/register.go
View file @
1b234658
...
...
@@ -21,15 +21,7 @@ import (
)
var
(
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder
runtime
.
SchemeBuilder
localSchemeBuilder
=
&
SchemeBuilder
AddToScheme
=
localSchemeBuilder
.
AddToScheme
)
func
init
()
{
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder
.
Register
(
addDefaultingFuncs
)
}
staging/src/k8s.io/apiserver/pkg/apis/config/v1alpha1/zz_generated.defaults.go
deleted
100644 → 0
View file @
a224e53d
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by defaulter-gen. DO NOT EDIT.
package
v1alpha1
import
(
runtime
"k8s.io/apimachinery/pkg/runtime"
)
// RegisterDefaults adds defaulters functions to the given scheme.
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func
RegisterDefaults
(
scheme
*
runtime
.
Scheme
)
error
{
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment