Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Wksctl
Commits
bf28f2ea
Commit
bf28f2ea
authored
5 years ago
by
Bryan Boreham
Browse files
Options
Download
Email Patches
Plain Diff
Re-use machine.GetKubernetesVersionFromManifest()
parent
cf562d2b
master
WKP-1012/update-weave-net-master
WKP-1116-kubectl-to-apiserver
WKP-1487/kubeconfig-default-dir-2
WKP-609/configurable-tests
add_tag_sign_comment
allow-low-disk
bump_capei_dep2
bump_capei_dep2_2
bump_capei_dep3
bump_capei_dep4
bump_capei_dep5
debug_ssh_key_error
dinamic_latest_capei_release
disable-hostpid
fix-spawn
fix-upgrade-centos-circleci
justin/kubernetes1.20
luxas-patch-1
make-wksctl-work-against-new-existinginfra
move-cidr
move-manifest
plan-context
release-0.9
remove-mem-limits
remove-test-yaml
test-image-update
test-updated-capei
test_both_centos_and_ubuntu_nodes
tracing
try-profiles
turn-controller-into-provider
update-examples-v1alpha3
update-gce-example-machines.yaml-generation
upgrade-flux-1-21
use-capei-at-increase-wks-controller-mem-limit
wip-tracing
v0.10.2
v0.10.1
v0.10.0
v0.9.0-rc.3
v0.9.0-rc.2
v0.9.0-rc.1
v0.9.0-beta.1
v0.9.0-alpha.4
v0.9.0-alpha.3
v0.9.0-alpha.2
v0.9.0-alpha.1
v0.9.0-alpha.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/wksctl/registrysynccommands/registrysynccommands.go
+1
-20
cmd/wksctl/registrysynccommands/registrysynccommands.go
with
1 addition
and
20 deletions
+1
-20
cmd/wksctl/registrysynccommands/registrysynccommands.go
+
1
-
20
View file @
bf28f2ea
...
...
@@ -10,11 +10,7 @@ import (
"github.com/weaveworks/wksctl/pkg/cluster/machine"
"github.com/weaveworks/wksctl/pkg/kubernetes"
"github.com/weaveworks/wksctl/pkg/registry"
"github.com/weaveworks/wksctl/pkg/utilities"
v
"github.com/weaveworks/wksctl/pkg/utilities/version"
"k8s.io/apimachinery/pkg/util/validation/field"
clusterv1
"sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1"
apierrors
"sigs.k8s.io/cluster-api/pkg/errors"
)
var
Cmd
=
&
cobra
.
Command
{
...
...
@@ -78,7 +74,7 @@ func registrySyncRun(cmd *cobra.Command, args []string) {
func
kubernetesVersionsRange
()
string
{
if
registrySyncOptions
.
machinesManifestPath
!=
""
{
version
,
err
:=
extrac
tKubernetesVersionFromMa
chin
es
(
registrySyncOptions
.
machinesManifestPath
)
version
,
_
,
err
:=
machine
.
Ge
tKubernetesVersionFromMa
nif
es
t
(
registrySyncOptions
.
machinesManifestPath
)
if
err
!=
nil
{
log
.
Fatalf
(
"Failed to extract Kubernetes version from machines manifest: %s"
,
err
)
}
...
...
@@ -89,18 +85,3 @@ func kubernetesVersionsRange() string {
}
return
v
.
AnyRange
}
func
extractKubernetesVersionFromMachines
(
machinesManifestPath
string
)
(
string
,
error
)
{
errorsHandler
:=
func
(
machines
[]
*
clusterv1
.
Machine
,
errors
field
.
ErrorList
)
([]
*
clusterv1
.
Machine
,
error
)
{
if
len
(
errors
)
>
0
{
utilities
.
PrintErrors
(
errors
)
return
nil
,
apierrors
.
InvalidMachineConfiguration
(
"%s failed validation"
,
machinesManifestPath
)
}
return
machines
,
nil
}
machines
,
err
:=
machine
.
ParseAndDefaultAndValidate
(
machinesManifestPath
,
errorsHandler
)
if
err
!=
nil
{
return
""
,
err
}
return
machines
[
0
]
.
Spec
.
Versions
.
Kubelet
,
nil
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help