Repository: kubernetes/kubernetes (language: go)

Issue:
The extra-dirs flag present in conversion-gen but not wired
### What happened?

The `extra-dirs` flag option is present in conversion-gen cmd but it is not wired in the code. Any inputs from `extra-dirs` are entirely unused and this can lead to confusion when those dirs are not considered during conversion-gen. It seems the `extra-dirs` is deprecated but the `extra-dirs` flag is the leftover that should be removed eventually.

### What did you expect to happen?

The `extra-dirs` flag shouldn't be an option in conversion-gen anymore. The conversion-gen cmd should err out if `extra-dirs` flag is included.

### How can we reproduce it (as minimally and precisely as possible)?

Use `conversion-gen` with `extra-dirs` flag and those inputs are not used but there is no error reported.

### Anything else we need to know?

_No response_

### Kubernetes version

<details>
1.31

```console
$ kubectl version
# paste output here
```

</details>


### Cloud provider

<details>
NA
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>



Discussion / hints:

Fix patch:
diff --git a/staging/src/k8s.io/code-generator/cmd/conversion-gen/args/args.go b/staging/src/k8s.io/code-generator/cmd/conversion-gen/args/args.go
index 02663bfce1a6d..eaadaa1b93ffe 100644
--- a/staging/src/k8s.io/code-generator/cmd/conversion-gen/args/args.go
+++ b/staging/src/k8s.io/code-generator/cmd/conversion-gen/args/args.go
@@ -45,11 +45,6 @@ type Args struct {
 	// generator pick up manually written conversion funcs from external packages.
 	ExtraPeerDirs []string
 
-	// Additional dirs to parse and load, but not consider for peers.  This is
-	// useful when packages depend on other packages and want to call
-	// conversions across them.
-	ExtraDirs []string
-
 	// SkipUnsafe indicates whether to generate unsafe conversions to improve the efficiency
 	// of these operations. The unsafe operation is a direct pointer assignment via unsafe
 	// (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to
@@ -84,8 +79,6 @@ func (args *Args) AddFlags(fs *pflag.FlagSet) {
 		"Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.")
 	fs.StringSliceVar(&args.ExtraPeerDirs, "extra-peer-dirs", args.ExtraPeerDirs,
 		"Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.")
-	fs.StringSliceVar(&args.ExtraDirs, "extra-dirs", args.ExtraDirs,
-		"Application specific comma-separated list of import paths which are loaded and considered for callable conversions, but are not considered peers for conversion.")
 	fs.BoolVar(&args.SkipUnsafe, "skip-unsafe", args.SkipUnsafe,
 		"If true, will not generate code using unsafe pointer conversions; resulting code may be slower.")
 	fs.StringVar(&args.GoHeaderFile, "go-header-file", "",


Test patch: