Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
8c3f5f08
Commit
8c3f5f08
authored
8 years ago
by
Smana
Browse files
Options
Downloads
Patches
Plain Diff
change licence to apache2
parent
c4beee38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/change_k8s_version.py
+25
-15
25 additions, 15 deletions
scripts/change_k8s_version.py
with
25 additions
and
15 deletions
scripts/change_k8s_version.py
+
25
−
15
View file @
8c3f5f08
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Kubespray
#
# This file is part of Kargo.
# 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
#
# Foobar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# http://www.apache.org/licenses/LICENSE-2.0
#
# Foobar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar. If not, see <http://www.gnu.org/licenses/>.
# 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.
import
os
import
sys
import
hashlib
...
...
@@ -90,11 +89,22 @@ if __name__ == '__main__':
)
args
=
parser
.
parse_args
()
file_sub
(
'
../roles/kubernetes/node/defaults/main.yml
'
,
r
'
.*hyperkube_image_repo.*
'
,
'
hyperkube_image_repo:
"
%s
"'
%
args
.
docker_repository
)
file_sub
(
'
../roles/kubernetes/node/defaults/main.yml
'
,
r
'
.*hyperkube_image_tag.*
'
,
'
hyperkube_image_tag:
"
%s
"'
%
args
.
kube_version
)
kargo_root_path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
file_sub
(
os
.
path
.
join
(
kargo_root_path
,
'
roles/kubernetes/node/defaults/main.yml
'
),
r
'
.*hyperkube_image_repo.*
'
,
'
hyperkube_image_repo:
"
%s
"'
%
args
.
docker_repository
)
file_sub
(
os
.
path
.
join
(
kargo_root_path
,
'
roles/kubernetes/node/defaults/main.yml
'
),
r
'
.*hyperkube_image_tag.*
'
,
'
hyperkube_image_tag:
"
%s
"'
%
args
.
kube_version
)
kube_binaries
=
[
'
kubelet
'
,
'
kubectl
'
,
'
kube-apiserver
'
]
var_files
=
[
'
../roles/uploads/vars/kube_versions.yml
'
,
'
../roles/download/vars/kube_versions.yml
'
]
var_files
=
[
os
.
path
.
join
(
kargo_root_path
,
'
roles/uploads/vars/kube_versions.yml
'
),
os
.
path
.
join
(
kargo_root_path
,
'
roles/download/vars/kube_versions.yml
'
)
]
kube_download_url
=
"
https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64
"
%
args
.
kube_version
new
=
get_kube_sha256
(
args
.
kube_version
,
kube_download_url
,
kube_binaries
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment