Skip to content

Conversation

@QiWang19
Copy link
Member

@QiWang19 QiWang19 commented Mar 23, 2021

  • Create new CRD ImageContentPolicy to config/v1.
  • The schema of ImageContentPolicy contain schemas from ImageContentSource operator/v1alpha1 , and a new field allowMirrorByTags support.
  • A Jira card was created to record the upgrade OCPNODE-717. The repositories currently rely on operator/v1alpha1 ImageContentSourcePolicy will be migrated to config/v1 ImageContentPolicy.

API enhancement: openshift/enhancements#690
Follow-up enhancement for adding ICSP to operator/v1: openshift/enhancements#873
REF: https://issues.redhat.com/browse/OCPNODE-521, #636
client-go PR: openshift/client-go#195

Signed-off-by: Qi Wang [email protected]

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: QiWang19
To complete the pull request process, please assign eparis after the PR has been reviewed.
You can assign the PR to them by writing /assign @eparis in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details 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

@QiWang19
Copy link
Member Author

/assign @eparis

@55octet
Copy link

55octet commented May 14, 2021

Any updates on when this will be a viable option?

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 14, 2021
@QiWang19
Copy link
Member Author

Any updates on when this will be a viable option?

This feature will be available in 4.9.

@slauger
Copy link

slauger commented May 27, 2021

It would be great if this "feature" can also be backported to the next EUS release (4.8).

Currently a lot of operators in the OLM are not (yet) using a digest. As a result a lot of customers cannot use the ImageContentSourcePolicy and need to configure a custom MachineConfig for the registries.conf.

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2021
@QiWang19 QiWang19 changed the title Add MirrorByDigestOnly under RepositoryDigestMirrors Add MirrorByDigestOnly to RepositoryDigestMirrors Jun 29, 2021
@QiWang19
Copy link
Member Author

/test verify

@QiWang19
Copy link
Member Author

QiWang19 commented Jun 29, 2021

@mrunalp @abhinavdahiya @wking @adambkaplan PTAL
With the new repositoryMirrors, should we go v1alpha2 and drop repositoryDigestMirrors as the comment openshift/enhancements#690 (comment) suggested? How will the plan to drop it, should it be removed in this PR?

// may impact the exact order mirrors are contacted in, or some mirrors may be contacted
// in parallel, so this should be considered a preference rather than a guarantee of ordering.
// +optional
Mirrors []string `json:"mirrors"`
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs a list-type, and add omitempty as optional slice.

Copy link
Contributor

Choose a reason for hiding this comment

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

what are these strings? URL? These need a specification too (as type Mirror string).

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not resolved.

type RepositoryMirrors struct {
// source is the repository that users refer to, e.g. in image pull specifications.
// +required
Source string `json:"source"`
Copy link
Contributor

Choose a reason for hiding this comment

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

which format does this have? Please specify regex, minlength, format, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not resolved. It needs specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

@QiWang19 Those specifications can be added as comments:

// +kubebuilder:validation:Pattern=`^https?:\/\/`
// +kubebuilder:validation:MaxLength=2048
// +kubebuilder:validation:Required
// +required

The pattern in this example is just an example... Is it URL format? or host:port format?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

the format should be specified like Ryan described above through kubebuilder:validation:Pattern

@nee1esh
Copy link

nee1esh commented Jul 2, 2021

/retest

@QiWang19 QiWang19 force-pushed the mirror-digest branch 7 times, most recently from 536d0c4 to 0f0599c Compare July 13, 2021 19:47
@QiWang19 QiWang19 changed the title Add allowMirrorByTags and add ImageContentSourcePolicy to v1 Add allowMirrorByTags and create ImageContentPolicy CRD to v1 Sep 21, 2021
@QiWang19 QiWang19 changed the title Add allowMirrorByTags and create ImageContentPolicy CRD to v1 Create ImageContentPolicy CRD to v1 and allowMirrorByTags support Sep 21, 2021
@QiWang19 QiWang19 force-pushed the mirror-digest branch 2 times, most recently from 55006e6 to 39a076c Compare September 22, 2021 18:21
@QiWang19
Copy link
Member Author

QiWang19 commented Sep 22, 2021

Added the ImageContentPolicy to the config/v1 group since it is not used for configuring an operator, according to the discussions from the thread: https://coreos.slack.com/archives/CK1AE4ZCK/p1632319949393200

@QiWang19 QiWang19 changed the title Create ImageContentPolicy CRD to v1 and allowMirrorByTags support Create ImageContentPolicy CRD to config/v1 and allowMirrorByTags support Sep 22, 2021
@QiWang19
Copy link
Member Author

@sttts @rphillips PTAL

kind: CustomResourceDefinition
metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/470
Copy link
Contributor

Choose a reason for hiding this comment

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

technically you have to switch this to 874 now

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR looks good to me. Thank you @sttts for helping us get this done. I'll lgtm once this link is fixed.

Add new CRD ImageContentPolicy to config/v1 group with allowMirrorByTags support.
The schema of ImageContentPolicy contains all the schema from ImageContentSource and allowMirrorByTags support.
Add validations of the fields.

Request for enhancement: https://issues.redhat.com/browse/RFE-1608
Epic: https://issues.redhat.com/browse/OCPNODE-521

Registry mirror set by ImageContentSourcePolicy registryDigestMirrors only will be used if the image
is referenced by digest because the mirror-by-digest of /etc/containers/registries.conf is set to true.
This causes issue since there are use cases where no digests are available.

In the new ImageContentPolicy CRD, add allowMirrorByTags to repositoryDigestMirrors spec, so user can
easily configure it in the same spot they set post-installation mirror configuration.

Signed-off-by: Qi Wang <[email protected]>
@rphillips
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 24, 2021
@sttts
Copy link
Contributor

sttts commented Sep 24, 2021

/hold cancel
/approve

@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 Sep 24, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: QiWang19, rphillips, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Sep 24, 2021
@openshift-merge-robot openshift-merge-robot merged commit 71bd82e into openshift:master Sep 24, 2021
QiWang19 added a commit to QiWang19/cluster-config-operator that referenced this pull request Sep 28, 2021
Bump api and client-go to include new CRD ImageContentPolicy openshift/api#874 .
Bump openshift/api to openshift/api@636513e
Bump openshift/client-go to openshift/client-go@067cd72

Signed-off-by: Qi Wang <[email protected]>
QiWang19 added a commit to QiWang19/cluster-config-operator that referenced this pull request Sep 28, 2021
Bump api and client-go to include new CRD ImageContentPolicy openshift/api#874 .
Bump openshift/api to openshift/api@636513e
Bump openshift/client-go to openshift/client-go@067cd72

Signed-off-by: Qi Wang <[email protected]>
@QiWang19
Copy link
Member Author

Changes added to opeshift/api by this PR is addressed in the enhancement openshift/enhancements#929

@bdurrow
Copy link

bdurrow commented Apr 18, 2022

As best I can tell, as of 4.10, OCPNODE-717 remains open and unimplemented. Until completed, ImageContentPolicy has no effect

@QiWang19
Copy link
Member Author

ImageContentPolicy won't be implemented. The design changed to use new CRDs ImageDigestMirrorSet and ImageTagMirrorSet https://issues.redhat.com/browse/OCPNODE-875 for the epic OCPNODE-521

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.