Change:
# Capture local require/replace directives before running any go commands that can modify the go.mod file local require_json="${local_tmp_dir}/require.json" local replace_json="${local_tmp_dir}/replace.json" <del> go mod edit -json | jq -r ".Require // [] | sort | .[] | select(${require_filter})" > "${require_json}" go mod edit -json | jq -r ".Replace // [] | sort | .[] | select(${replace_filter})" > "${replace_json}" </del> <ins> go mod edit -json  | jq -r ".Require // [] | sort | .[] | select(${require_filter})"  > "${require_json}" go mod edit -json  | jq -r ".Replace // [] | sort | .[] | select(${replace_filter})"  > "${replace_json}" </ins> # 1a. Ensure replace directives have an explicit require directive <del> jq -r '"-require (.Old.Path)@(.New.Version)"' < "${replace_json}" | xargs -L 100 go mod edit -fmt </del> <ins> jq -r '"-require (.Old.Path)@(.New.Version)"' < "${replace_json}"  | xargs -L 100 go mod edit -fmt </ins> # 1b. Ensure require directives have a corresponding replace directive pinning a version <del> jq -r '"-replace (.Path)=(.Path)@(.Version)"' < "${require_json}" | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Old.Path)=(.New.Path)@(.New.Version)"' < "${replace_json}" | xargs -L 100 go mod edit -fmt </del> <ins> jq -r '"-replace (.Path)=(.Path)@(.Version)"' < "${require_json}"  | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Old.Path)=(.New.Path)@(.New.Version)"' < "${replace_json}"  | xargs -L 100 go mod edit -fmt </ins> # 2. Propagate root replace/require directives into staging modules, in case we are downgrading, so they don't bump the root required version back up for repo in $(kube::util::list_staging_repos); do pushd "staging/src/k8s.io/${repo}" >/dev/null 2>&1 <del> jq -r '"-require (.Path)@(.Version)"' < "${require_json}" | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Path)=(.Path)@(.Version)"' < "${require_json}" | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Old.Path)=(.New.Path)@(.New.Version)"' < "${replace_json}" | xargs -L 100 go mod edit -fmt </del> <ins> jq -r '"-require (.Path)@(.Version)"' < "${require_json}"  | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Path)=(.Path)@(.Version)"' < "${require_json}"  | xargs -L 100 go mod edit -fmt jq -r '"-replace (.Old.Path)=(.New.Path)@(.New.Version)"' < "${replace_json}"  | xargs -L 100 go mod edit -fmt </ins> popd >/dev/null 2>&1 done # 3. Add explicit require directives for indirect dependencies <del> go list -m -json all | jq -r 'select(.Main != true) | select(.Indirect == true) | "-require (.Path)@(.Version)"'          | xargs -L 100 go mod edit -fmt </del> <ins> go list -m -json all  | jq -r 'select(.Main != true) | select(.Indirect == true) | "-require (.Path)@(.Version)"'  | xargs -L 100 go mod edit -fmt </ins> # 4. Add explicit replace directives pinning dependencies that aren't pinned yet <del> go list -m -json all | jq -r 'select(.Main != true) | select(.Replace == null)  | "-replace (.Path)=(.Path)@(.Version)"' | xargs -L 100 go mod edit -fmt </del> <ins> go list -m -json all  | jq -r 'select(.Main != true) | select(.Replace == null)  | "-replace (.Path)=(.Path)@(.Version)"'  | xargs -L 100 go mod edit -fmt </ins> } function group_replace_directives() {

Discussion:
I ran update- Not to see a ton of errors Kubernetes version (use ): HEAD of master
There are no sig labels on this issue. Please add an appropriate label by using one of the following commands: - Please see the for a listing of the SIGs, working groups, and committees available. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig architecture (code organization / dependencies) /sig testing (hack scripts)
/triage accepted