Skip to content

Commit 54b2fd9

Browse files
authored
Merge pull request #332 from Sneha-at/module-update-master
Update dependency go modules for k8s v1.28.0
2 parents 6e02d62 + 529df22 commit 54b2fd9

File tree

20 files changed

+868
-733
lines changed

20 files changed

+868
-733
lines changed

go.mod

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ require (
66
github.com/container-storage-interface/spec v1.8.0
77
github.com/google/gofuzz v1.2.0 // indirect
88
github.com/imdario/mergo v0.3.12 // indirect
9-
github.com/kubernetes-csi/csi-lib-utils v0.13.0
9+
github.com/kubernetes-csi/csi-lib-utils v0.14.0
1010
golang.org/x/oauth2 v0.8.0 // indirect
1111
golang.org/x/term v0.10.0 // indirect
1212
google.golang.org/appengine v1.6.7 // indirect
1313
google.golang.org/grpc v1.54.0
14-
k8s.io/api v0.28.0-rc.0
15-
k8s.io/apimachinery v0.28.0-rc.0
16-
k8s.io/apiserver v0.28.0-rc.0
17-
k8s.io/client-go v0.28.0-rc.0
18-
k8s.io/component-base v0.28.0-rc.0
19-
k8s.io/csi-translation-lib v0.28.0-rc.0
14+
k8s.io/api v0.28.0
15+
k8s.io/apimachinery v0.28.0
16+
k8s.io/apiserver v0.28.0
17+
k8s.io/client-go v0.28.0
18+
k8s.io/component-base v0.28.0
19+
k8s.io/csi-translation-lib v0.28.0
2020
k8s.io/klog/v2 v2.100.1
2121
)
2222

@@ -52,7 +52,7 @@ require (
5252
github.com/prometheus/procfs v0.10.1 // indirect
5353
github.com/spf13/cobra v1.7.0 // indirect
5454
github.com/spf13/pflag v1.0.5 // indirect
55-
golang.org/x/net v0.12.0 // indirect
55+
golang.org/x/net v0.13.0 // indirect
5656
golang.org/x/sys v0.10.0 // indirect
5757
golang.org/x/text v0.11.0 // indirect
5858
golang.org/x/time v0.3.0 // indirect
@@ -67,3 +67,17 @@ require (
6767
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
6868
sigs.k8s.io/yaml v1.3.0 // indirect
6969
)
70+
71+
replace k8s.io/api => k8s.io/api v0.28.0
72+
73+
replace k8s.io/apimachinery => k8s.io/apimachinery v0.28.0
74+
75+
replace k8s.io/apiserver => k8s.io/apiserver v0.28.0
76+
77+
replace k8s.io/client-go => k8s.io/client-go v0.28.0
78+
79+
replace k8s.io/component-base => k8s.io/component-base v0.28.0
80+
81+
replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.28.0
82+
83+
replace k8s.io/kms => k8s.io/kms v0.28.0

go.sum

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
6161
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
6262
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
6363
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
64-
github.com/kubernetes-csi/csi-lib-utils v0.13.0 h1:QrTdZVZbHlaSUBN9ReayBPnnF1N0edFIpUKBwVIBW3w=
65-
github.com/kubernetes-csi/csi-lib-utils v0.13.0/go.mod h1:JS9eDIZmSjx4F9o0bLTVK/qfhIIOifdjEfVXzxWapfE=
64+
github.com/kubernetes-csi/csi-lib-utils v0.14.0 h1:pusB32LkSd7GhuT8Z6cyRFqByujc28ygWV97ndaT19s=
65+
github.com/kubernetes-csi/csi-lib-utils v0.14.0/go.mod h1:uX8xidqxGJOLXtsfCCVsxWtZl/9NiLyd2DD3Nb+KoP4=
6666
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
6767
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
6868
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
@@ -114,8 +114,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
114114
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
115115
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
116116
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
117-
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
118-
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
117+
golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY=
118+
golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
119119
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
120120
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
121121
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -167,18 +167,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
167167
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
168168
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
169169
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
170-
k8s.io/api v0.28.0-rc.0 h1:F6Qksl4B9mauFIDpbsuq6534wla3Oug8imAl/2qN8QE=
171-
k8s.io/api v0.28.0-rc.0/go.mod h1:vJAkpE9dgnkmGebOLnZqAwSzu2+nTFJ3XdCFWe+Mjr0=
172-
k8s.io/apimachinery v0.28.0-rc.0 h1:qh5r3Vk+HADGQx4zI99eZzXOCMutZj2/UlTKCY2/ePM=
173-
k8s.io/apimachinery v0.28.0-rc.0/go.mod h1:xhQIsaL3hXneGluH+0pzF7kr+VYuLS/VcYJxF1xQf+g=
174-
k8s.io/apiserver v0.28.0-rc.0 h1:yyZHxB83gIVWBVrao82cAxg1GA9JI0ECQ3oOZQFAgYo=
175-
k8s.io/apiserver v0.28.0-rc.0/go.mod h1:l8reKzfZB2HtFPLd7Rl1Jb8hHdacN8O+0hWP5gRqp28=
176-
k8s.io/client-go v0.28.0-rc.0 h1:fL9kSASMgDyDD9uVMevQR0aqBY7Mczb/GzsqlUNwq4Q=
177-
k8s.io/client-go v0.28.0-rc.0/go.mod h1:KZq8b8mjSNmYMofEo2M7XEehqaonyBZFw5fdsups46Y=
178-
k8s.io/component-base v0.28.0-rc.0 h1:MFPluB1AXf6AzHs1qoBS1JJ1xAFeL0Ideb3QAMdk3s0=
179-
k8s.io/component-base v0.28.0-rc.0/go.mod h1:I22ElTkO4PGZjhokvW89/x8thAZm6tI73juVAcrvErs=
180-
k8s.io/csi-translation-lib v0.28.0-rc.0 h1:cZXo3dpKD4ul2TUKZI7SGsSOBKjC8cgr49PcZQEPQNI=
181-
k8s.io/csi-translation-lib v0.28.0-rc.0/go.mod h1:oupNm6CKl+m2DfA0EdpMajlucgDhUyQxU1vphbzd09w=
170+
k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM=
171+
k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY=
172+
k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA=
173+
k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
174+
k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY=
175+
k8s.io/apiserver v0.28.0/go.mod h1:MvLmtxhQ0Tb1SZk4hfJBjs8iqr5nhYeaFSaoEcz7Lk4=
176+
k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM=
177+
k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc=
178+
k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI=
179+
k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk=
180+
k8s.io/csi-translation-lib v0.28.0 h1:X3Kr5aHvH4xutNg4pgdc6RP0h3FOlJGDeui5CLfBeO4=
181+
k8s.io/csi-translation-lib v0.28.0/go.mod h1:HvnmmGZoTobqMU4MD3yQFJ4U4Dq3PxnCfVbJUjky3K0=
182182
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
183183
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
184184
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=

release-tools/SIDECAR_RELEASE_PROCESS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The release manager must:
1717
Whenever a new Kubernetes minor version is released, our kubernetes-csi CI jobs
1818
must be updated.
1919

20-
[Our CI jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) have the
20+
[Our CI jobs](https://testgrid.k8s.io/sig-storage-csi-ci) have the
2121
naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
2222

2323
1. Jobs should be actively monitored to find and fix failures in sidecars and
@@ -90,19 +90,19 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
9090
1. Submit a PR for README changes, in particular, Compatibility, Feature status,
9191
and any other sections that may need updating.
9292
1. Check that all [canary CI
93-
jobs](https://k8s-testgrid.appspot.com/sig-storage-csi-ci) are passing,
93+
jobs](https://testgrid.k8s.io/sig-storage-csi-ci) are passing,
9494
and that test coverage is adequate for the changes that are going into the release.
9595
1. Check that the post-\<sidecar\>-push-images builds are succeeding.
96-
[Example](https://k8s-testgrid.appspot.com/sig-storage-image-build#post-external-snapshotter-push-images)
96+
[Example](https://testgrid.k8s.io/sig-storage-image-build#post-external-snapshotter-push-images)
9797
1. Make sure that no new PRs have merged in the meantime, and no PRs are in
9898
flight and soon to be merged.
9999
1. Create a new release following a previous release as a template. Be sure to select the correct
100100
branch. This requires Github release permissions as required by the prerequisites.
101101
[external-provisioner example](https://github.com/kubernetes-csi/external-provisioner/releases/new)
102102
1. If release was a new major/minor version, create a new `release-<minor>`
103103
branch at that commit.
104-
1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build).
105-
1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From
104+
1. Check [image build status](https://testgrid.k8s.io/sig-storage-image-build).
105+
1. Promote images from k8s-staging-sig-storage to registry.k8s.io/sig-storage. From
106106
the [k8s image
107107
repo](https://github.com/kubernetes/k8s.io/tree/HEAD/registry.k8s.io/images/k8s-staging-sig-storage),
108108
run `./generate.sh > images.yaml`, and send a PR with the updated images.
@@ -120,7 +120,7 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
120120

121121
The following jobs are triggered after tagging to produce the corresponding
122122
image(s):
123-
https://k8s-testgrid.appspot.com/sig-storage-image-build
123+
https://testgrid.k8s.io/sig-storage-image-build
124124

125125
Clicking on a failed build job opens that job in https://prow.k8s.io. Next to
126126
the job title is a rerun icon (circle with arrow). Clicking it opens a popup

release-tools/cloudbuild.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/image-pushing/README.md
1414
# for more details on image pushing process in Kubernetes.
1515
#
16-
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage.
16+
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/registry.k8s.io/images/k8s-staging-sig-storage.
1717

1818
# This must be specified in seconds. If omitted, defaults to 600s (10 mins).
1919
# Building three images in external-snapshotter takes more than an hour.
@@ -26,7 +26,7 @@ steps:
2626
# The image must contain bash and curl. Ideally it should also contain
2727
# the desired version of Go (currently defined in release-tools/prow.sh),
2828
# but that just speeds up the build and is not required.
29-
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20230424-910a2a439d'
29+
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20230623-56e06d7c18'
3030
entrypoint: ./.cloudbuild.sh
3131
env:
3232
- GIT_TAG=${_GIT_TAG}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Copyright 2023 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import argparse
16+
import datetime
17+
import re
18+
from collections import defaultdict
19+
import subprocess
20+
import shutil
21+
from dateutil.relativedelta import relativedelta
22+
23+
def check_gh_command():
24+
"""
25+
Pretty much everything is processed from `gh`
26+
Check that the `gh` command is in the path before anything else
27+
"""
28+
if not shutil.which('gh'):
29+
print("Error: The `gh` command is not available in the PATH.")
30+
print("Please install the GitHub CLI (https://cli.github.com/) and try again.")
31+
exit(1)
32+
33+
def duration_ago(dt):
34+
"""
35+
Humanize duration outputs
36+
"""
37+
delta = relativedelta(datetime.datetime.now(), dt)
38+
if delta.years > 0:
39+
return f"{delta.years} year{'s' if delta.years > 1 else ''} ago"
40+
elif delta.months > 0:
41+
return f"{delta.months} month{'s' if delta.months > 1 else ''} ago"
42+
elif delta.days > 0:
43+
return f"{delta.days} day{'s' if delta.days > 1 else ''} ago"
44+
elif delta.hours > 0:
45+
return f"{delta.hours} hour{'s' if delta.hours > 1 else ''} ago"
46+
elif delta.minutes > 0:
47+
return f"{delta.minutes} minute{'s' if delta.minutes > 1 else ''} ago"
48+
else:
49+
return "just now"
50+
51+
def parse_version(version):
52+
"""
53+
Parse version assuming it is in the form of v1.2.3
54+
"""
55+
pattern = r"v(\d+)\.(\d+)\.(\d+)"
56+
match = re.match(pattern, version)
57+
if match:
58+
major, minor, patch = map(int, match.groups())
59+
return (major, minor, patch)
60+
61+
def end_of_life_grouped_versions(versions):
62+
"""
63+
Calculate the end of life date for a minor release version according to : https://kubernetes-csi.github.io/docs/project-policies.html#support
64+
65+
The input is an array of tuples of:
66+
* grouped versions (e.g. 1.0, 1.1)
67+
* array of that contains all versions and their release date (e.g. 1.0.0, 01-01-2013)
68+
69+
versions structure example :
70+
[((3, 5), [('v3.5.0', datetime.datetime(2023, 4, 27, 22, 28, 6))]),
71+
((3, 4),
72+
[('v3.4.1', datetime.datetime(2023, 4, 5, 17, 41, 15)),
73+
('v3.4.0', datetime.datetime(2022, 12, 27, 23, 43, 41))])]
74+
"""
75+
supported_versions = []
76+
# Prepare dates for later calculation
77+
now = datetime.datetime.now()
78+
one_year = datetime.timedelta(days=365)
79+
three_months = datetime.timedelta(days=90)
80+
81+
# get the newer versions on top
82+
sorted_versions_list = sorted(versions.items(), key=lambda x: x[0], reverse=True)
83+
84+
# the latest version is always supported no matter the release date
85+
latest = sorted_versions_list.pop(0)
86+
supported_versions.append(latest[1][-1])
87+
88+
for v in sorted_versions_list:
89+
first_release = v[1][-1]
90+
last_release = v[1][0]
91+
# if the release is less than a year old we support the latest patch version
92+
if now - first_release[1] < one_year:
93+
supported_versions.append(last_release)
94+
# if the main release is older than a year and has a recent path, this is supported
95+
elif now - last_release[1] < three_months:
96+
supported_versions.append(last_release)
97+
return supported_versions
98+
99+
def get_release_docker_image(repo, version):
100+
"""
101+
Extract docker image name from the release page documentation
102+
"""
103+
output = subprocess.check_output(['gh', 'release', '-R', repo, 'view', version], text=True)
104+
#Extract matching image name excluding `
105+
match = re.search(r"docker pull ([\.\/\-\:\w\d]*)", output)
106+
docker_image = match.group(1) if match else ''
107+
return((version, docker_image))
108+
109+
def get_versions_from_releases(repo):
110+
"""
111+
Using `gh` cli get the github releases page details then
112+
create a list of grouped version on major.minor
113+
and for each give all major.minor.patch with release dates
114+
"""
115+
# Run the `gh release` command to get the release list
116+
output = subprocess.check_output(['gh', 'release', '-R', repo, 'list'], text=True)
117+
# Parse the output and group by major and minor version numbers
118+
versions = defaultdict(lambda: [])
119+
for line in output.strip().split('\n'):
120+
parts = line.split('\t')
121+
# pprint.pprint(parts)
122+
version = parts[0]
123+
parsed_version = parse_version(version)
124+
if parsed_version is None:
125+
continue
126+
major, minor, patch = parsed_version
127+
128+
published = datetime.datetime.strptime(parts[3], '%Y-%m-%dT%H:%M:%SZ')
129+
versions[(major, minor)].append((version, published))
130+
return(versions)
131+
132+
133+
def main():
134+
manual = """
135+
This script lists the supported versions Github releases according to https://kubernetes-csi.github.io/docs/project-policies.html#support
136+
It has been designed to help to update the tables from : https://kubernetes-csi.github.io/docs/sidecar-containers.html\n\n
137+
It can take multiple repos as argument, for all CSI sidecars details you can run:
138+
./get_supported_version_csi-sidecar.py -R kubernetes-csi/external-attacher -R kubernetes-csi/external-provisioner -R kubernetes-csi/external-resizer -R kubernetes-csi/external-snapshotter -R kubernetes-csi/livenessprobe -R kubernetes-csi/node-driver-registrar -R kubernetes-csi/external-health-monitor\n
139+
With the output you can then update the documentation manually.
140+
"""
141+
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description=manual)
142+
parser.add_argument('--repo', '-R', required=True, action='append', dest='repos', help='The name of the repository in the format owner/repo.')
143+
parser.add_argument('--display', '-d', action='store_true', help='(default) Display EOL versions with their dates', default=True)
144+
parser.add_argument('--doc', '-D', action='store_true', help='Helper to https://kubernetes-csi.github.io/docs/ that prints Docker image for each EOL version')
145+
146+
args = parser.parse_args()
147+
148+
# Verify pre-reqs
149+
check_gh_command()
150+
151+
# Process all repos
152+
for repo in args.repos:
153+
versions = get_versions_from_releases(repo)
154+
eol_versions = end_of_life_grouped_versions(versions)
155+
156+
if args.display:
157+
print(f"Supported versions with release date and age of `{repo}`:\n")
158+
for version in eol_versions:
159+
print(f"{version[0]}\t{version[1].strftime('%Y-%m-%d')}\t{duration_ago(version[1])}")
160+
161+
# TODO : generate proper doc output for the tables of: https://kubernetes-csi.github.io/docs/sidecar-containers.html
162+
if args.doc:
163+
print("\nSupported Versions with docker images for each end of life version:\n")
164+
for version in eol_versions:
165+
_, image = get_release_docker_image(repo, version[0])
166+
print(f"{version[0]}\t{image}")
167+
print()
168+
169+
if __name__ == '__main__':
170+
main()

0 commit comments

Comments
 (0)