cli/command/stack/kubernetes/deploy_test.go:65:68: `checkOwnerReferences` - `stackName` always receives `"test"` (unparam)

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
Silvin Lubecki 2019-04-02 13:27:01 +02:00 committed by Sebastiaan van Stijn
parent ab1aeedb27
commit a3c7cb4f12
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 8 additions and 8 deletions

View File

@ -56,16 +56,16 @@ func TestCreateChildResourcesV1Beta1(t *testing.T) {
secrets))
c, err := configs.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, c.ObjectMeta, "test", v1beta1.SchemeGroupVersion.String())
checkOwnerReferences(t, c.ObjectMeta, v1beta1.SchemeGroupVersion.String())
s, err := secrets.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, s.ObjectMeta, "test", v1beta1.SchemeGroupVersion.String())
checkOwnerReferences(t, s.ObjectMeta, v1beta1.SchemeGroupVersion.String())
}
func checkOwnerReferences(t *testing.T, objMeta metav1.ObjectMeta, stackName, stackVersion string) {
func checkOwnerReferences(t *testing.T, objMeta metav1.ObjectMeta, stackVersion string) {
t.Helper()
assert.Equal(t, len(objMeta.OwnerReferences), 1)
assert.Equal(t, objMeta.OwnerReferences[0].Name, stackName)
assert.Equal(t, objMeta.OwnerReferences[0].Name, "test")
assert.Equal(t, objMeta.OwnerReferences[0].Kind, "Stack")
assert.Equal(t, objMeta.OwnerReferences[0].APIVersion, stackVersion)
}
@ -82,10 +82,10 @@ func TestCreateChildResourcesV1Beta2(t *testing.T) {
secrets))
c, err := configs.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, c.ObjectMeta, "test", v1beta2.SchemeGroupVersion.String())
checkOwnerReferences(t, c.ObjectMeta, v1beta2.SchemeGroupVersion.String())
s, err := secrets.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, s.ObjectMeta, "test", v1beta2.SchemeGroupVersion.String())
checkOwnerReferences(t, s.ObjectMeta, v1beta2.SchemeGroupVersion.String())
}
func TestCreateChildResourcesV1Alpha3(t *testing.T) {
@ -100,10 +100,10 @@ func TestCreateChildResourcesV1Alpha3(t *testing.T) {
secrets))
c, err := configs.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, c.ObjectMeta, "test", v1alpha3.SchemeGroupVersion.String())
checkOwnerReferences(t, c.ObjectMeta, v1alpha3.SchemeGroupVersion.String())
s, err := secrets.Get("test", metav1.GetOptions{})
assert.NilError(t, err)
checkOwnerReferences(t, s.ObjectMeta, "test", v1alpha3.SchemeGroupVersion.String())
checkOwnerReferences(t, s.ObjectMeta, v1alpha3.SchemeGroupVersion.String())
}
func TestCreateChildResourcesWithStackCreationErrorV1Beta1(t *testing.T) {