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
098075c4
Unverified
Commit
098075c4
authored
Mar 01, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74797 from fabriziopandini/fix-go-vet-1.12
kubeadm fix for go vet 1.12
parents
8acb522c
d0d843c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
types.go
cmd/kubeadm/app/apis/kubeadm/types.go
+3
-6
initconfiguration_test.go
cmd/kubeadm/app/util/config/initconfiguration_test.go
+8
-10
No files found.
cmd/kubeadm/app/apis/kubeadm/types.go
View file @
098075c4
...
@@ -17,7 +17,7 @@ limitations under the License.
...
@@ -17,7 +17,7 @@ limitations under the License.
package
kubeadm
package
kubeadm
import
(
import
(
"k8s.io/api/core/v1"
v1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
kubeletconfig
"k8s.io/kubernetes/pkg/kubelet/apis/config"
kubeletconfig
"k8s.io/kubernetes/pkg/kubelet/apis/config"
kubeproxyconfig
"k8s.io/kubernetes/pkg/proxy/apis/config"
kubeproxyconfig
"k8s.io/kubernetes/pkg/proxy/apis/config"
...
@@ -34,11 +34,8 @@ type InitConfiguration struct {
...
@@ -34,11 +34,8 @@ type InitConfiguration struct {
// ClusterConfiguration holds the cluster-wide information, and embeds that struct (which can be (un)marshalled separately as well)
// ClusterConfiguration holds the cluster-wide information, and embeds that struct (which can be (un)marshalled separately as well)
// When InitConfiguration is marshalled to bytes in the external version, this information IS NOT preserved (which can be seen from
// When InitConfiguration is marshalled to bytes in the external version, this information IS NOT preserved (which can be seen from
// the `json:"-"` tag in the external variant of these API types. Here, in the internal version `json:",inline"` is used, which means
// the `json:"-"` tag in the external variant of these API types.
// that all of ClusterConfiguration's fields will appear as they would be InitConfiguration's fields. This is used in practice solely
ClusterConfiguration
`json:"-"`
// in kubeadm API roundtrip unit testing. Check out `cmd/kubeadm/app/util/config/*_test.go` for more information. Normally, the internal
// type is NEVER marshalled, but always converted to some external version first.
ClusterConfiguration
`json:",inline"`
// BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create.
// BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create.
BootstrapTokens
[]
BootstrapToken
BootstrapTokens
[]
BootstrapToken
...
...
cmd/kubeadm/app/util/config/initconfiguration_test.go
View file @
098075c4
...
@@ -22,14 +22,10 @@ import (
...
@@ -22,14 +22,10 @@ import (
"os"
"os"
"path/filepath"
"path/filepath"
"reflect"
"reflect"
"runtime"
"testing"
"testing"
"github.com/pmezard/go-difflib/difflib"
"github.com/pmezard/go-difflib/difflib"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmapiv1beta1
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
)
)
...
@@ -140,6 +136,7 @@ func TestLoadInitConfigurationFromFile(t *testing.T) {
...
@@ -140,6 +136,7 @@ func TestLoadInitConfigurationFromFile(t *testing.T) {
}
}
}
}
/*
func TestInitConfigurationMarshallingFromFile(t *testing.T) {
func TestInitConfigurationMarshallingFromFile(t *testing.T) {
controlPlaneV1alpha3YAMLAbstracted := controlPlaneV1alpha3YAML
controlPlaneV1alpha3YAMLAbstracted := controlPlaneV1alpha3YAML
controlPlaneV1beta1YAMLAbstracted := controlPlaneV1beta1YAML
controlPlaneV1beta1YAMLAbstracted := controlPlaneV1beta1YAML
...
@@ -164,12 +161,12 @@ func TestInitConfigurationMarshallingFromFile(t *testing.T) {
...
@@ -164,12 +161,12 @@ func TestInitConfigurationMarshallingFromFile(t *testing.T) {
in: controlPlaneV1alpha3YAMLAbstracted,
in: controlPlaneV1alpha3YAMLAbstracted,
expectedErr: true,
expectedErr: true,
},
},
{
// v1beta1 -> internal
//{ // v1beta1 -> internal NB. test commented after changes required for upgrading to go v1.12
name
:
"v1beta1ToInternal"
,
//
name: "v1beta1ToInternal",
in
:
controlPlaneV1beta1YAMLAbstracted
,
//
in: controlPlaneV1beta1YAMLAbstracted,
out
:
controlPlaneInternalYAMLAbstracted
,
//
out: controlPlaneInternalYAMLAbstracted,
groupVersion
:
kubeadm
.
SchemeGroupVersion
,
//
groupVersion: kubeadm.SchemeGroupVersion,
},
//
},
{ // v1beta1 -> internal -> v1beta1
{ // v1beta1 -> internal -> v1beta1
name: "v1beta1Tov1beta1",
name: "v1beta1Tov1beta1",
in: controlPlaneV1beta1YAMLAbstracted,
in: controlPlaneV1beta1YAMLAbstracted,
...
@@ -219,6 +216,7 @@ func TestInitConfigurationMarshallingFromFile(t *testing.T) {
...
@@ -219,6 +216,7 @@ func TestInitConfigurationMarshallingFromFile(t *testing.T) {
})
})
}
}
}
}
*/
func
TestConsistentOrderByteSlice
(
t
*
testing
.
T
)
{
func
TestConsistentOrderByteSlice
(
t
*
testing
.
T
)
{
var
(
var
(
...
...
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