Skip to content

Conversation

@Prashanth684
Copy link
Contributor

@Prashanth684 Prashanth684 commented Aug 16, 2024

As per openshift/enhancements#1605, there was a
new field introduced in the image config spec and status which reflects
the global value to be set for imagestream import mode which is behind a
featuregate. This PR reads the image config status, checks if the importmode
string is present and syncs that value in the imagepolicyconfig of the
observed config to be used by the apiserver.

API changes: openshift/api#1928
openshift-apiserver changes: openshift/openshift-apiserver#443
image-registry-operator changes: openshift/cluster-image-registry-operator#1090

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 16, 2024

@Prashanth684: This pull request references MULTIARCH-4557 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

Details

In response to this:

As per openshift/enhancements#1605, there was a
new field introduced in the image config spec and status which reflects
the global value to be set for imagestream import mode which is behind a
featuregate. This PR reads the image config status, checks if the importmode
string is present and syncs that value in the imagepolicyconfig of the
observed config to be used by the apiserver.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 20, 2024

@Prashanth684: This pull request references MULTIARCH-4557 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

Details

In response to this:

As per openshift/enhancements#1605, there was a
new field introduced in the image config spec and status which reflects
the global value to be set for imagestream import mode which is behind a
featuregate. This PR reads the image config status, checks if the importmode
string is present and syncs that value in the imagepolicyconfig of the
observed config to be used by the apiserver.

API changes: openshift/api#1928
openshift-apiserver changes: openshift/openshift-apiserver#443
image-registry-operator changes: openshift/cluster-image-registry-operator#1090

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

Overall, looks good to me.

@Prashanth684 Prashanth684 force-pushed the importmode-imagestream branch from 946f24b to ec69e2b Compare August 21, 2024 22:59
@Prashanth684
Copy link
Contributor Author

/test e2e-aws-ovn

Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/lgtm

@dinhxuanvu
Copy link
Member

@tkashem @p0lyn0mial For final revie and approval.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@openshift-merge-robot openshift-merge-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 22, 2024
@Prashanth684
Copy link
Contributor Author

/test e2e-aws-ovn

Copy link
Contributor

@tkashem tkashem left a comment

Choose a reason for hiding this comment

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

Have a few minor comments
/approve
Thanks

}

func ObserveImagestreamImportMode(genericListers configobserver.Listers, recorder events.Recorder, existingConfig map[string]interface{}) (map[string]interface{}, []error) {
listers := genericListers.(configobservation.Listers)
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to use lister := configobserver.ImageConfigLister directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the ImageConfigLister is under the Listers object here which is passed through here. I believe that is why it is done this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkashem is my observation correct, or is there another way to do it?

configImage, err := listers.ImageConfigLister.Get("cluster")
if errors.IsNotFound(err) {
klog.Warningf("image.config.openshift.io/cluster: not found")
return observedConfig, errs
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please, perhaps with a comment, clarify why we have to special case NotFound here, and return observedConfig (empty) instead of prevObservedConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

honestly, i followed the pattern of the other observer functions in this file. Going back, it looks like #57 introduced it. That is a good question but I don't know what the motivation for that was.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe because if the object is not found, it has been potentially removed and in that case we want it to be empty?

Copy link
Contributor

Choose a reason for hiding this comment

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

probably yes, @sanchezl if the cluster object (the thing we are observing for config) is missing, is it an error, or the operator does its best to continue with the old configuration?

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 19, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2024
@Prashanth684 Prashanth684 force-pushed the importmode-imagestream branch 2 times, most recently from 0a2c4aa to b283df7 Compare September 24, 2024 17:09
…erved config

As per openshift/enhancements#1605, there was a
new field introduced in the image config spec and status which reflects
the global value to be set for imagestream import mode which is behind a
featuregate. This PR reads the image config status, checks if the importmode
string is present and syncs that value in the imagepolicyconfig of the
observed config to be used by the apiserver.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 24, 2024

@Prashanth684: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-operator-encryption-rotation-aesgcm 0f0e3a7 link false /test e2e-gcp-operator-encryption-rotation-aesgcm

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

@Prashanth684
Copy link
Contributor Author

/test e2e-upgrade

@aleskandro
Copy link
Member

/lgtm

@tkashem
Copy link
Contributor

tkashem commented Sep 26, 2024

/lgtm

/hold
(cancel if you are not waiting for others to review)

@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 Sep 26, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2024
@Prashanth684
Copy link
Contributor Author

/hold cancel

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleskandro, dinhxuanvu, Prashanth684, tkashem

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 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit fe18366 into openshift:master Sep 26, 2024
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-openshift-apiserver-operator
This PR has been included in build ose-cluster-openshift-apiserver-operator-container-v4.18.0-202409262111.p0.gfe18366.assembly.stream.el9.
All builds following this will include this PR.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants