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

[OCPNODE-1258] Support both icsp and idms #346

Merged
merged 2 commits into from Jul 21, 2023

Conversation

QiWang19
Copy link
Member

@QiWang19 QiWang19 commented Sep 22, 2022

Append ImageDigestMirrorSet to current ImageContentSourcePolicy. The OCPNODE-521 will land new CRDs for image mirror configurations to replace ICSP in the future release.

ImageDigestMirrorSet implemented: openshift/machine-config-operator#3037
ImageDigestMirrorSet epic: https://issues.redhat.com/browse/OCPNODE-521

@QiWang19
Copy link
Member Author

QiWang19 commented Oct 4, 2022

/hold
for 4.13 tree to open

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2022
@QiWang19 QiWang19 changed the title [OCPNODE-1258] Migrate icsp to idms [OCPNODE-1258] Support both icsp and idms Oct 21, 2022
@QiWang19
Copy link
Member Author

/hold cancel
4.13 branch is open

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2022
@dmage
Copy link
Member

dmage commented Oct 21, 2022

/hold
master is still 4.12

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2022
@QiWang19
Copy link
Member Author

QiWang19 commented Nov 4, 2022

@dmage 4.13 branch is open, this is ready for review. I have rebased this branch, not sure why the ci failed. Could you help take a look?

@flavianmissi
Copy link
Member

/unassign @dmage
/assign @flavianmissi
/hold cancel

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 9, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2023
@flavianmissi
Copy link
Member

@QiWang19 please rebase. Let's see if the test failures persist afterwards.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2023
@QiWang19
Copy link
Member Author

Copy link
Member

@flavianmissi flavianmissi left a comment

Choose a reason for hiding this comment

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

Looks pretty good, thanks for doing this.
Left a few comments, please take a look.

pkg/dockerregistry/server/simplelookupicsp.go Outdated Show resolved Hide resolved
pkg/dockerregistry/server/simplelookupicsp.go Outdated Show resolved Hide resolved

if len(icspList.Items) > 0 && len(idmsList.Items) > 0 {
klog.Errorf("error finding both icsp and idms resources at the same time: %s", err)
return []reference.DockerImageReference{ref.AsRepository()}, nil
Copy link
Member

Choose a reason for hiding this comment

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

I think we should surface an error here so that this doesn't go unnoticed to the caller.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed this in line68 and line73.

pkg/dockerregistry/server/simplelookupicsp.go Outdated Show resolved Hide resolved
pkg/dockerregistry/server/simplelookupicsp.go Outdated Show resolved Hide resolved
@flavianmissi
Copy link
Member

flavianmissi commented Jan 11, 2023

@QiWang19 I'm not sure about your failing test. You can try running it against your own cluster with

KUBECONFIG=<path-to-kubeconfig> GOTEST_FLAGS="-p 1 -mod vendor" DOCKER_API_VERSION=1.24 hack/test-go.sh test/integration/*

@QiWang19
Copy link
Member Author

@QiWang19 I'm not sure about your failing test. You can try running it against your own cluster with

KUBECONFIG=<path-to-kubeconfig> GOTEST_FLAGS="-p 1 -mod vendor" DOCKER_API_VERSION=1.24 hack/test-go.sh test/integration/*

Thanks! I will try running the test to make sure the code in this patch is correct.

@QiWang19
Copy link
Member Author

The error is

--- FAIL: TestPullThroughIDMS (9.79s)
    project.go:42: project image-registry-test-integration-idms is created
    registry.go:505: created ephemeral registry: ephemeral-registry-jznd4-image-registry-test-integration-idms.apps.ci-ln-6g0lzsk-76ef8.origin-ci-int-aws.dev.rhcloud.com (ephemeral-registry-jznd4)
    pullthrough_test.go:542: unexpected status 0: v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"Internal error occurred: does.not.exist/repo/image@sha256:c1d7a836008fcd9cd6cd2b4b4735bd0c2fef0590b468aedd84abbd6d476032e0: Get \"http://does.not.exist/v2/\": dial tcp: lookup does.not.exist on 172.30.0.10:53: no such host", Reason:"InternalError", Details:(*v1.StatusDetails)(0xc000cb3c80), Code:500}


But this test reuses most of TestPullThroughICSP. I need to look into why it failed.

@dmage
Copy link
Member

dmage commented Jan 11, 2023

@QiWang19 the error seems to be from image streams, did you implement IDMS for image streams? (they live inside openshift/openshift-apiserver)

@QiWang19
Copy link
Member Author

QiWang19 commented Jan 11, 2023

@flavianmissi
Copy link
Member

flavianmissi commented Jan 12, 2023

@QiWang19 I suspect that TestPullThroughIDMS won't pass until openshift/openshift-apiserver#318 is merged... You might want to validate that by deploying a cluster with this PR and openshift/openshift-apiserver#318 together, then running your test again on that cluster. If the test passes then we just need to wait, otherwise you have an actual test failure to troubleshoot.

Relatedly, I see that openshift/openshift-apiserver#318 adds support for both ImageDigestMirrorSet and ImageTagMirrorSet, but here you only covered ImageDigestMirrorSet. Do we not do pull-through by tag? 🤔

@QiWang19
Copy link
Member Author

QiWang19 commented Jan 26, 2023

The PR openshift/openshift-apiserver#318 was failing to launch a 4.13 cluster, I will continue to retest the integration test.

Relatedly, I see that openshift/openshift-apiserver#318 adds support for both ImageDigestMirrorSet and ImageTagMirrorSet, but here you only covered ImageDigestMirrorSet. Do we not do pull-through by tag? thinking

@flavianmissi Current image-registry only looks up icsp objects that supports only the digest image pull. I didn't know if the image-registry want to add the imageTagMirrorSet for tag pulls, so only added ImageDigestMirrorSet to keep the same image pull behavior as with ICSP. I can update the PR to add support for tag pulls. What do you think?
It seems the openshift-apiserver and image-registry should be in alignment.

@QiWang19
Copy link
Member Author

/retest-required

@flavianmissi
Copy link
Member

The ICSP will be dropped at least after 4.17 to allow the EUS to EUS upgrade.

that makes sense.

Given that not all CI clusters use default IDMS/ICSP, one way to keep the ICSP test by 4.17 is before the TestPullThroughICSP function creates ICSP, in this PR we add a check to see if there's a default IDMS on the cluster [...]

that seems to be the best course of action for now. can you add it to this PR then?

@flavianmissi
Copy link
Member

I think master is open to 4.14 development now @QiWang19 🎉

@QiWang19
Copy link
Member Author

QiWang19 commented Mar 9, 2023

@flavianmissi Thanks for letting me know about the development for the next release. ❤️
I have rebased this PR and addressed the previous reviews. This is ready for another round of review.
We will hold this before the ci cluster gets updated with the IDMS object per our discussion above.

@QiWang19
Copy link
Member Author

QiWang19 commented May 8, 2023

@flavianmissi I rebased openshift/openshift-apiserver#318, do you know which part of the ci script is related to this PR for the pre-merge test?
I have a draft PR: openshift/release#39122

@flavianmissi
Copy link
Member

do you know which part of the ci script is related to this PR for the pre-merge test?
@QiWang19 do you mean where are the pre-merge tests for image stream import located? I'm actually not sure 🤔
@dmage do you happen to know? I looked around a bit but it wasn't obvious (to me...)

@dmage
Copy link
Member

dmage commented May 9, 2023

@QiWang19 what job are you talking about? openshift/release has a special logic with ICSP for "disconnected" clusters, which is not specific to the image-registry repo nor openshift-apiserver.

1 similar comment
@dmage
Copy link
Member

dmage commented May 9, 2023

@QiWang19 what job are you talking about? openshift/release has a special logic with ICSP for "disconnected" clusters, which is not specific to the image-registry repo nor openshift-apiserver.

@QiWang19
Copy link
Member Author

QiWang19 commented May 9, 2023

@dmage This PR failed the test cases creating IDMS objects because the ci cluster has an existing ICSP objects. I am thinking about updating the openshft/release script can change the existing ICSP object to IDMS object so this PR can pass the test.
But I am not sure if changing openshift/release logic from ICSP to IDMS requires IDMS support from this image-registry

which is not specific to the image-registry repo nor openshift-apiserver

So the openshift/release logic with ICSP does not rely on image-registry?

@dmage
Copy link
Member

dmage commented May 17, 2023

@QiWang19 openshift/release is a huge thing, it runs on OCP and uses additional OCP clusters to install and test other OCP clusters; all these clusters have a few instances of the image registry.

The latest test results for this PR are few months old and don't seem to be related to this PR.
/retest

@QiWang19
Copy link
Member Author

@dmage I just remembered your comment we should openshift/openshift-apiserver#318 should get this in first.

Can we merge that or that PR still needs to hold for pre-merge testing? I rebased that 3 weeks ago.

@dinhxuanvu
Copy link
Member

@QiWang19 FYI, the rebase is merged.

Signed-off-by: Qi Wang <qiwan@redhat.com>
Signed-off-by: Qi Wang <qiwan@redhat.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 18, 2023

@QiWang19: all tests passed!

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.

@QiWang19
Copy link
Member Author

@flavianmissi I rebased after openshift/openshift-apiserver#318 merged. Can we get this in?

@QiWang19
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 18, 2023
@QiWang19
Copy link
Member Author

@dmage Can we get this in?

@dmage
Copy link
Member

dmage commented Jul 21, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmage, QiWang19

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2023
@openshift-merge-robot openshift-merge-robot merged commit ccfad6f into openshift:master Jul 21, 2023
9 checks passed
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

5 participants