Let's introduce this new functionality incrementally: at first the check will
run, but won't fail "make verify". Once we have gained more confidence and
experience with it, this commit can be reverted to make documentation
mandatory again.
When the repo is in a detached HEAD state (`git checkout origin/master`)
the cherrypick script fails with:
fatal: ref HEAD is not a symbolic ref
because HEAD isn't pointing at a specific branch. The script only needs
the current branch in order to return the user to the branch afterwards.
We can fallback to tracking the detached HEAD commit so the script
returns the user back to the same commit.
detectNumCPU sized nf_conntrack_max using github.com/google/cadvisor/lib
machine topology. nf_conntrack_max is host-wide, so it must be sized from the
node's CPU count, not runtime.NumCPU(): the latter honors the process cpuset
and undercounts when kube-proxy runs under a static CPU policy, which is the
behavior cadvisor worked around (kubernetes/kubernetes#99225).
Use cpuset.NumCPU() from k8s.io/utils, which reads the node's online CPU count
from /sys/devices/system/cpu/online, with a runtime.NumCPU() fallback. This
drops the cadvisor dependency from pkg/proxy/conntrack and bumps k8s.io/utils
to pick up cpuset.NumCPU.
This replaces complex shell code for "parsing" the CHANGELOG.md with a
dedicated Go tool, which is more robust and simpler. The tool adds support
for ellipsis(= ...) on a separate line within the verbatim text block
of the CHANGELOG.md as a wildcard that matches one or more lines in the full
output of incompatible changes.
- Introduce `cloud_provider_calls_total` counter metric to track calls to the cloud provider, broken down by operation ("instance_exists", "instance_shutdown", "instance_metadata") and result ("success", "error", "instance_not_found", "not_implemented").
- Introduce `monitor_nodes_duration_seconds` histogram metric to track the duration of the entire MonitorNodes loop.
- Add unit tests verifying the counter metrics.
Migrate the kubelet (and the kube-proxy conntrack helper) off the full github.com/google/cadvisor module onto the lean github.com/google/cadvisor/lib: repoint info/v1+info/v2 type usage to lib/model and the manager/fs/cache/etc. consumers to lib/*; regenerate the cadvisor.Interface mocks; keep the kubelet-pinned cAdvisor global flags via lib/cadvisorflags.
go.mod: require + replace github.com/google/cadvisor/lib (=> the dims/cadvisor/lib fork for now, until lib is tagged) and drop the full github.com/google/cadvisor module entirely; keep github.com/containerd/containerd/api at v1.11.0 (matching upstream master); add github.com/google/cadvisor to unwanted-dependencies.json unwantedModules so the full module cannot be re-vendored.
test/e2e_node: the one remaining consumer of the full module -- the node-e2e ResourceCollector, which used the v2 HTTP client (client/v2) + v2 API types (info/v2) -- now scrapes the standalone cAdvisor pod's /api/v2.1/stats directly over HTTP+JSON, so test/e2e_node depends on no cAdvisor package. No change to the kubelet's stats surfaces.
The new version includes a generic /envvar endpoint in netexec that
reads any named environment variable, enabling e2e tests to retrieve
spec.nodeName via the Downward API instead of relying on os.Hostname().
Ref: https://github.com/kubernetes/k8s.io/pull/9608
Signed-off-by: Jitesh Kumar <jiteshkumardj@gmail.com>
Removing konnectivity-client from the list of packages allowed to use
the unwanted "github.com/golang/protobuf" package. ANP has switched to
using the "google.golang.org/protobuf" package.
Hand-written custom validation functions follow the ValidateCustom_<Type>
naming convention required by validation-gen, like Convert_* and
SetDefaults_*.
When "-m -t <merge commit revision>" are used, the diff and potential changelog
entry are about a merged pull request. This will be used to update the
CHANGELOG.md files for past Kubernetes releases.
When incompatible changes are detected in a directory like
./staging/src/k8s.io/client-go, the script checks if there is a
CHANGELOG.md file. If not, it behaves as before.
If it exists, it checks whether the file documents the change (must be included
verbatim in code block). If yes, the change is not considered a reason for
failure. If no, it gets reported as before and the overall result is a failure.
If incompatible changes are detected in directories with a changelog,
instructions are printed at the end which explain how to update the changelog
so that the next update of the pull request passes without failures: when the
new -u flag gets passed, the script adds a new section at the top of the
changelog file after the introduction. Developers then need to replace the
template text and include their documentation in their pull request.
With these changes, pull-kubernetes-apidiff-client-go can become merge-blocking:
- If there are only compatible changes, it already didn't fail.
- If there are incompatible changes, extending the changelog
will make the check pass without failures.
A similar job can be added for apimachinery, or a combined job can check both.
pull-kubernetes-apidiff remains advisory: it cannot block merging because it
also checks directories for which no changelog is maintained.
Ensures that code formatting updates and verifications are executed using the
project's target Go toolchain version (specified in .go-version) instead of
the host system's global gofmt executable. Bypasses PATH configuration limits
by dynamically resolving and calling the GOROOT-aligned gofmt binary, which
prevents version mismatches in containerized development setups.
The sort tool in hack/tools/instrumentation/sort/ shadows /usr/bin/sort
when installed into GOBIN. Scripts like hack/verify-deadcode-elimination.sh
prepend GOBIN to PATH, causing the coreutil sort to be replaced by this
Go binary, which breaks unrelated verifiers.
The tool is not used by any automation, so remove it from the install
line. Also rename the directory from sort/ to metric-sort/ to prevent
future accidental PATH shadowing.