New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IR-172: Run remote registries for pull-through tests as pods #258
Conversation
pkg/testframework/registry.go
Outdated
|
||
name := "ephemeral-registry-" + utilrand.String(5) | ||
|
||
var cleaners []func() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var cleaners []CleanupFunc
pkg/testframework/registry.go
Outdated
env = append(env, corev1.EnvVar{ | ||
Name: "REGISTRY_AUTH_HTPASSWD_PATH", | ||
Value: "/auth/htpasswd", | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduce this to a single append function call.
pkg/testframework/manifest.go
Outdated
data := Schema2ImageData{ | ||
ConfigMediaType: "application/vnd.docker.container.image.v1+json", | ||
Config: []byte("{}"), | ||
Config: []byte(configContent), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded "conversion" to []byte
pkg/testframework/manifest.go
Outdated
return nil, fmt.Errorf("upload image config: %w", err) | ||
} | ||
|
||
manifest, _, err := distribution.UnmarshalManifest(data.ManifestMediaType, data.Manifest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to be the first operation would avoid unneeded uploads in case of failure.
pkg/testframework/registry.go
Outdated
|
||
var lastErr error | ||
err = wait.Poll(time.Second, 30*time.Second, func() (done bool, err error) { | ||
pod, err := kubeClient.CoreV1().Pods(namespace).Get(ctx, name, metav1.GetOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this be part of []cleaners ?
w.WriteHeader(http.StatusUnauthorized) | ||
return | ||
} | ||
remoteRegistryAddr, _, _ := testframework.CreateEphemeralRegistry(t, master.AdminKubeConfig(), testproject.Name, map[string]string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why to ignore returned cleaners? or why to return cleaners at all if they are ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one test needs to delete the ephemeral registry in the middle of the test, other tests can rely on namespace deletion
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to cover the absence of "ImportSuccess" condition here? does it always exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it always exists, in worst case the next step will fail
} | ||
})) | ||
defer ts.Close() | ||
remoteRegistryAddr, _, _ := testframework.CreateEphemeralRegistry(t, master.AdminKubeConfig(), namespace, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my previous comment on "cleaners" being ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dmage, ricardomaraschini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
@dmage: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/cherrypick release-4.6 |
@dmage: #258 failed to apply on top of branch "release-4.6":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
No description provided.