chore(hack): Fix modernize linter (#26304)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2026-02-06 23:15:45 +01:00
committed by GitHub
parent f85ad11b2a
commit 6e0c949dd2
4 changed files with 5 additions and 5 deletions

View File

@@ -179,7 +179,7 @@ func generateCommandsDocs(out io.Writer) error {
if err := doc.GenMarkdown(c, &cmdDesc); err != nil {
return fmt.Errorf("error generating Markdown for command: %v : %w", c, err)
}
for _, line := range strings.Split(cmdDesc.String(), "\n") {
for line := range strings.SplitSeq(cmdDesc.String(), "\n") {
if strings.HasPrefix(line, "### SEE ALSO") {
break
}

View File

@@ -75,7 +75,7 @@ func deleteFile(path string) {
func removeValidation(un *unstructured.Unstructured, path string) {
schemaPath := []string{"spec", "versions[*]", "schema", "openAPIV3Schema"}
for _, part := range strings.Split(path, ".") {
for part := range strings.SplitSeq(path, ".") {
schemaPath = append(schemaPath, "properties", part)
}
unstructured.RemoveNestedField(un.Object, schemaPath...)

View File

@@ -157,7 +157,7 @@ func (cg *ClusterGenerator) getClusterServerURI(namespace string, releaseSuffix
}
func (cg *ClusterGenerator) retrieveClusterURI(namespace, releaseSuffix string) string {
for i := 0; i < 10; i++ {
for range 10 {
log.Print("Attempting to get cluster uri")
uri, err := cg.getClusterServerURI(namespace, releaseSuffix)
if err != nil {
@@ -189,7 +189,7 @@ func (cg *ClusterGenerator) generate(i int, opts *util.GenerateOpts) error {
log.Print("Get cluster credentials")
caData, cert, key, err := cg.getClusterCredentials(namespace, releaseSuffix)
for o := 0; o < 5; o++ {
for range 5 {
if err == nil {
break
}

View File

@@ -35,7 +35,7 @@ func main() {
attempts := 5
interval := time.Second
for i := 0; i < attempts; i++ {
for range attempts {
_, err = client.ServerVersion()
if err == nil {
break