Skip to content
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

Merged
merged 1 commit into from Dec 4, 2020

Conversation

dmage
Copy link
Member

@dmage dmage commented Dec 1, 2020

No description provided.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2020
@dmage dmage changed the title WIP IR-172: Run remote registries for pull-through tests as pods Dec 3, 2020

name := "ephemeral-registry-" + utilrand.String(5)

var cleaners []func()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var cleaners []CleanupFunc

env = append(env, corev1.EnvVar{
Name: "REGISTRY_AUTH_HTPASSWD_PATH",
Value: "/auth/htpasswd",
})
Copy link
Contributor

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.

data := Schema2ImageData{
ConfigMediaType: "application/vnd.docker.container.image.v1+json",
Config: []byte("{}"),
Config: []byte(configContent),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneeded "conversion" to []byte

return nil, fmt.Errorf("upload image config: %w", err)
}

manifest, _, err := distribution.UnmarshalManifest(data.ManifestMediaType, data.Manifest)
Copy link
Contributor

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.


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{})
Copy link
Contributor

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{
Copy link
Contributor

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?

Copy link
Member Author

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

}
}
}
}
Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Contributor

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.

Copy link
Contributor

@ricardomaraschini ricardomaraschini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2020
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

openshift-merge-robot commented Dec 4, 2020

@dmage: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/integration d5c0aaf link /test integration

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 205d50e into openshift:master Dec 4, 2020
@dmage
Copy link
Member Author

dmage commented Feb 19, 2021

/cherrypick release-4.6

@openshift-cherrypick-robot

@dmage: #258 failed to apply on top of branch "release-4.6":

Applying: Run registries for pull-through in pods
.git/rebase-apply/patch:29224: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	go.mod
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
Removing vendor/golang.org/x/sync/errgroup/errgroup.go
Removing vendor/golang.org/x/sync/PATENTS
Removing vendor/golang.org/x/sync/LICENSE
Removing vendor/golang.org/x/sync/CONTRIBUTORS
Removing vendor/golang.org/x/sync/AUTHORS
Removing vendor/github.com/opencontainers/runc/libcontainer/system/xattrs_linux.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_32.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/proc.go
Removing vendor/github.com/opencontainers/runc/libcontainer/system/linux.go
Removing vendor/github.com/docker/docker/pkg/pools/pools.go
Removing vendor/github.com/docker/docker/pkg/fileutils/fileutils_windows.go
Removing vendor/github.com/docker/docker/pkg/fileutils/fileutils_unix.go
Removing vendor/github.com/docker/docker/pkg/fileutils/fileutils_darwin.go
Removing vendor/github.com/docker/docker/pkg/fileutils/fileutils.go
Removing vendor/github.com/docker/docker/pkg/archive/wrap.go
Removing vendor/github.com/docker/docker/pkg/archive/whiteouts.go
Removing vendor/github.com/docker/docker/pkg/archive/time_unsupported.go
Removing vendor/github.com/docker/docker/pkg/archive/time_linux.go
Removing vendor/github.com/docker/docker/pkg/archive/diff.go
Removing vendor/github.com/docker/docker/pkg/archive/copy_windows.go
Removing vendor/github.com/docker/docker/pkg/archive/copy_unix.go
Removing vendor/github.com/docker/docker/pkg/archive/copy.go
Removing vendor/github.com/docker/docker/pkg/archive/changes_windows.go
Removing vendor/github.com/docker/docker/pkg/archive/changes_unix.go
Removing vendor/github.com/docker/docker/pkg/archive/changes_other.go
Removing vendor/github.com/docker/docker/pkg/archive/changes_linux.go
Removing vendor/github.com/docker/docker/pkg/archive/changes.go
Removing vendor/github.com/docker/docker/pkg/archive/archive_windows.go
Removing vendor/github.com/docker/docker/pkg/archive/archive_unix.go
Removing vendor/github.com/docker/docker/pkg/archive/archive_other.go
Removing vendor/github.com/docker/docker/pkg/archive/archive_linux.go
Removing vendor/github.com/docker/docker/pkg/archive/archive.go
Removing vendor/github.com/docker/docker/pkg/archive/README.md
Removing vendor/github.com/docker/docker/client/volume_remove.go
Removing vendor/github.com/docker/docker/client/volume_prune.go
Removing vendor/github.com/docker/docker/client/volume_list.go
Removing vendor/github.com/docker/docker/client/volume_inspect.go
Removing vendor/github.com/docker/docker/client/volume_create.go
Removing vendor/github.com/docker/docker/client/version.go
Removing vendor/github.com/docker/docker/client/utils.go
Removing vendor/github.com/docker/docker/client/transport.go
Removing vendor/github.com/docker/docker/client/task_logs.go
Removing vendor/github.com/docker/docker/client/task_list.go
Removing vendor/github.com/docker/docker/client/task_inspect.go
Removing vendor/github.com/docker/docker/client/swarm_update.go
Removing vendor/github.com/docker/docker/client/swarm_unlock.go
Removing vendor/github.com/docker/docker/client/swarm_leave.go
Removing vendor/github.com/docker/docker/client/swarm_join.go
Removing vendor/github.com/docker/docker/client/swarm_inspect.go
Removing vendor/github.com/docker/docker/client/swarm_init.go
Removing vendor/github.com/docker/docker/client/swarm_get_unlock_key.go
Removing vendor/github.com/docker/docker/client/service_update.go
Removing vendor/github.com/docker/docker/client/service_remove.go
Removing vendor/github.com/docker/docker/client/service_logs.go
Removing vendor/github.com/docker/docker/client/service_list.go
Removing vendor/github.com/docker/docker/client/service_inspect.go
Removing vendor/github.com/docker/docker/client/service_create.go
Removing vendor/github.com/docker/docker/client/secret_update.go
Removing vendor/github.com/docker/docker/client/secret_remove.go
Removing vendor/github.com/docker/docker/client/secret_list.go
Removing vendor/github.com/docker/docker/client/secret_inspect.go
Removing vendor/github.com/docker/docker/client/secret_create.go
Removing vendor/github.com/docker/docker/client/request.go
Removing vendor/github.com/docker/docker/client/plugin_upgrade.go
Removing vendor/github.com/docker/docker/client/plugin_set.go
Removing vendor/github.com/docker/docker/client/plugin_remove.go
Removing vendor/github.com/docker/docker/client/plugin_push.go
Removing vendor/github.com/docker/docker/client/plugin_list.go
Removing vendor/github.com/docker/docker/client/plugin_install.go
Removing vendor/github.com/docker/docker/client/plugin_inspect.go
Removing vendor/github.com/docker/docker/client/plugin_enable.go
Removing vendor/github.com/docker/docker/client/plugin_disable.go
Removing vendor/github.com/docker/docker/client/plugin_create.go
Removing vendor/github.com/docker/docker/client/ping.go
Removing vendor/github.com/docker/docker/client/options.go
Removing vendor/github.com/docker/docker/client/node_update.go
Removing vendor/github.com/docker/docker/client/node_remove.go
Removing vendor/github.com/docker/docker/client/node_list.go
Removing vendor/github.com/docker/docker/client/node_inspect.go
Removing vendor/github.com/docker/docker/client/network_remove.go
Removing vendor/github.com/docker/docker/client/network_prune.go
Removing vendor/github.com/docker/docker/client/network_list.go
Removing vendor/github.com/docker/docker/client/network_inspect.go
Removing vendor/github.com/docker/docker/client/network_disconnect.go
Removing vendor/github.com/docker/docker/client/network_create.go
Removing vendor/github.com/docker/docker/client/network_connect.go
Removing vendor/github.com/docker/docker/client/login.go
Removing vendor/github.com/docker/docker/client/interface_stable.go
Removing vendor/github.com/docker/docker/client/interface_experimental.go
Removing vendor/github.com/docker/docker/client/interface.go
Removing vendor/github.com/docker/docker/client/info.go
Removing vendor/github.com/docker/docker/client/image_tag.go
Removing vendor/github.com/docker/docker/client/image_search.go
Removing vendor/github.com/docker/docker/client/image_save.go
Removing vendor/github.com/docker/docker/client/image_remove.go
Removing vendor/github.com/docker/docker/client/image_push.go
Removing vendor/github.com/docker/docker/client/image_pull.go
Removing vendor/github.com/docker/docker/client/image_prune.go
Removing vendor/github.com/docker/docker/client/image_load.go
Removing vendor/github.com/docker/docker/client/image_list.go
Removing vendor/github.com/docker/docker/client/image_inspect.go
Removing vendor/github.com/docker/docker/client/image_import.go
Removing vendor/github.com/docker/docker/client/image_history.go
Removing vendor/github.com/docker/docker/client/image_create.go
Removing vendor/github.com/docker/docker/client/image_build.go
Removing vendor/github.com/docker/docker/client/hijack.go
Removing vendor/github.com/docker/docker/client/events.go
Removing vendor/github.com/docker/docker/client/errors.go
Removing vendor/github.com/docker/docker/client/distribution_inspect.go
Removing vendor/github.com/docker/docker/client/disk_usage.go
Removing vendor/github.com/docker/docker/client/container_wait.go
Removing vendor/github.com/docker/docker/client/container_update.go
Removing vendor/github.com/docker/docker/client/container_unpause.go
Removing vendor/github.com/docker/docker/client/container_top.go
Removing vendor/github.com/docker/docker/client/container_stop.go
Removing vendor/github.com/docker/docker/client/container_stats.go
Removing vendor/github.com/docker/docker/client/container_start.go
Removing vendor/github.com/docker/docker/client/container_restart.go
Removing vendor/github.com/docker/docker/client/container_resize.go
Removing vendor/github.com/docker/docker/client/container_rename.go
Removing vendor/github.com/docker/docker/client/container_remove.go
Removing vendor/github.com/docker/docker/client/container_prune.go
Removing vendor/github.com/docker/docker/client/container_pause.go
Removing vendor/github.com/docker/docker/client/container_logs.go
Removing vendor/github.com/docker/docker/client/container_list.go
Removing vendor/github.com/docker/docker/client/container_kill.go
Removing vendor/github.com/docker/docker/client/container_inspect.go
Removing vendor/github.com/docker/docker/client/container_export.go
Removing vendor/github.com/docker/docker/client/container_exec.go
Removing vendor/github.com/docker/docker/client/container_diff.go
Removing vendor/github.com/docker/docker/client/container_create.go
Removing vendor/github.com/docker/docker/client/container_copy.go
Removing vendor/github.com/docker/docker/client/container_commit.go
Removing vendor/github.com/docker/docker/client/container_attach.go
Removing vendor/github.com/docker/docker/client/config_update.go
Removing vendor/github.com/docker/docker/client/config_remove.go
Removing vendor/github.com/docker/docker/client/config_list.go
Removing vendor/github.com/docker/docker/client/config_inspect.go
Removing vendor/github.com/docker/docker/client/config_create.go
Removing vendor/github.com/docker/docker/client/client_windows.go
Removing vendor/github.com/docker/docker/client/client_unix.go
Removing vendor/github.com/docker/docker/client/client_deprecated.go
Removing vendor/github.com/docker/docker/client/client.go
Removing vendor/github.com/docker/docker/client/checkpoint_list.go
Removing vendor/github.com/docker/docker/client/checkpoint_delete.go
Removing vendor/github.com/docker/docker/client/checkpoint_create.go
Removing vendor/github.com/docker/docker/client/build_prune.go
Removing vendor/github.com/docker/docker/client/build_cancel.go
Removing vendor/github.com/docker/docker/client/README.md
Removing vendor/github.com/docker/docker/api/types/volume/volume_list.go
Removing vendor/github.com/docker/docker/api/types/volume/volume_create.go
Removing vendor/github.com/docker/docker/api/types/time/timestamp.go
Removing vendor/github.com/docker/docker/api/types/time/duration_convert.go
Removing vendor/github.com/docker/docker/api/types/image/image_history.go
Removing vendor/github.com/docker/docker/api/types/events/events.go
Removing vendor/github.com/docker/docker/api/swagger.yaml
Removing vendor/github.com/docker/docker/api/swagger-gen.yaml
Removing vendor/github.com/docker/docker/api/common_windows.go
Removing vendor/github.com/docker/docker/api/common_unix.go
Removing vendor/github.com/docker/docker/api/common.go
Removing vendor/github.com/docker/docker/api/README.md
Removing vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go
Removing vendor/github.com/containerd/continuity/sysx/xattr.go
Removing vendor/github.com/containerd/continuity/sysx/nodata_unix.go
Removing vendor/github.com/containerd/continuity/sysx/nodata_solaris.go
Removing vendor/github.com/containerd/continuity/sysx/nodata_linux.go
Removing vendor/github.com/containerd/continuity/sysx/generate.sh
Removing vendor/github.com/containerd/continuity/sysx/file_posix.go
Removing vendor/github.com/containerd/continuity/sysx/README.md
Removing vendor/github.com/containerd/continuity/syscallx/syscall_windows.go
Removing vendor/github.com/containerd/continuity/syscallx/syscall_unix.go
Removing vendor/github.com/containerd/continuity/fs/time.go
Removing vendor/github.com/containerd/continuity/fs/stat_linux.go
Removing vendor/github.com/containerd/continuity/fs/stat_bsd.go
Removing vendor/github.com/containerd/continuity/fs/path.go
Removing vendor/github.com/containerd/continuity/fs/hardlink_windows.go
Removing vendor/github.com/containerd/continuity/fs/hardlink_unix.go
Removing vendor/github.com/containerd/continuity/fs/hardlink.go
Removing vendor/github.com/containerd/continuity/fs/du_windows.go
Removing vendor/github.com/containerd/continuity/fs/du_unix.go
Removing vendor/github.com/containerd/continuity/fs/du.go
Removing vendor/github.com/containerd/continuity/fs/dtype_linux.go
Removing vendor/github.com/containerd/continuity/fs/diff_windows.go
Removing vendor/github.com/containerd/continuity/fs/diff_unix.go
Removing vendor/github.com/containerd/continuity/fs/diff.go
Removing vendor/github.com/containerd/continuity/fs/copy_windows.go
Removing vendor/github.com/containerd/continuity/fs/copy_unix.go
Removing vendor/github.com/containerd/continuity/fs/copy_linux.go
Removing vendor/github.com/containerd/continuity/fs/copy.go
Removing test/integration/pullthrough/data_test.go
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Run registries for pull-through in pods
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-4.6

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants