
All wrappers except for ExpectNoError are identical to their gomega counterparts. The only advantage that they have is that their invocations are shorter. That advantage does not outweigh their disadvantages: - cannot be used in combination with gomega.Eventually/Consistently - not a full replacement for gomega, so we just end up using both - don't support passing a stack offset and thus cannot be used in helper functions - ginkgolinter does not work for them, so sub-optimal calls like this one are not reported: framework.ExpectEqual(len(items), 0) -> gomega.Expect(items).To(gomega.BeEmpty()) - developers try to make do with what's available in the framework, leading to sub-optimal checks like this: framework.ExpectEqual(true, strings.Contains(event.Message, expectedEventError), "Event error should indicate non-root policy caused container to not start") -> gomega.Expect(event.Message).To(gomega.ContainSubstring(expectedEventError), "Event error should indicate non-root policy caused container to not start") So let's remove these wrappers. As a first step they get marked as deprecated. This enables stricter linting (https://github.com/kubernetes/kubernetes/pull/109728), once enabled, to report new code which uses them.
Kubernetes hack GuideLines
This document describes how you can use the scripts from hack
directory
and gives a brief introduction and explanation of these scripts.
Overview
The hack
directory contains many scripts that ensure continuous development of kubernetes,
enhance the robustness of the code, improve development efficiency, etc.
The explanations and descriptions of these scripts are helpful for contributors.
For details, refer to the following guidelines.
Key scripts
verify-all.sh
: This script is a vestigial redirection, Please do not add "real" logic. It is equivalent tomake verify
.update-all.sh
: This script is a vestigial redirection, Please do not add "real" logic. Thetrue
target of this makerule ishack/make-rules/update.sh
.It is equivalent tomake update
.
Attention
Note that all scripts must be run from the Kubernetes root directory.
We should run hack/verify-all.sh
before submitting a PR and if anything fails run hack/update-all.sh
.