Skip to content

Conversation

hongkailiu
Copy link
Member

Before this full, the logging was only for the case that findClusterIncludeConfigFromInstallConfig is called, i.e., the path from an install-config file is provided.

This pull extends it to the case where the
configuration is taken from the current cluster.

Another change from the pull is that the logging
messages include the target version that is determined by inspecting the release image. The implementation for this is adding a new callback ImageConfigCallback.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 23, 2025
@openshift-ci-robot
Copy link

@hongkailiu: This pull request explicitly references no jira issue.

In response to this:

Before this full, the logging was only for the case that findClusterIncludeConfigFromInstallConfig is called, i.e., the path from an install-config file is provided.

This pull extends it to the case where the
configuration is taken from the current cluster.

Another change from the pull is that the logging
messages include the target version that is determined by inspecting the release image. The implementation for this is adding a new callback ImageConfigCallback.

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 openshift-ci bot requested review from ardaguclu and deads2k June 23, 2025 16:43
Copy link
Contributor

openshift-ci bot commented Jun 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hongkailiu
Once this PR has been reviewed and has the lgtm label, please assign ardaguclu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2025
Before this full, the logging was only for the case
that `findClusterIncludeConfigFromInstallConfig` is
called, i.e., the path from an install-config
file is provided.

This pull extends it to the case where the
configuration is taken from the current cluster.

Another change from the pull is that the logging
messages include the target version that is determined
by inspecting the release image. The implementation
for this is adding a new callback `ImageConfigCallback`.
@petr-muller
Copy link
Member

/cc

@openshift-ci openshift-ci bot requested a review from petr-muller July 7, 2025 12:46
Comment on lines +384 to +386
inclusionConfig, err = findClusterIncludeConfig(ctx, o.RESTConfig, versionInImageConfig)
} else {
inclusionConfig, err = findClusterIncludeConfigFromInstallConfig(ctx, o.InstallConfig)
inclusionConfig, err = findClusterIncludeConfigFromInstallConfig(ctx, o.InstallConfig, versionInImageConfig)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I am missing something but I don't understand when is versionInImageConfig actually populated. What I'm reading is:

  1. It is empty on L354 when declared
  2. It can be populated on L371 inside the opts.ImageConfigCallback callback (which itself is populated on L355)
  3. It can only be actually populated once opts.ImageConfigCallback is called at least one
  4. The callback is called in pkg/cli/image/extract/extract.go:L426 in o.Run()
  5. Here on L384 / L386 we expect this to be a populated string already but I do not see any opportunity betwen L372 and the L383 if where o.Run() could be called, even indirectly.

How is versionInImageConfig not always an empty string on L384/L386??

Copy link
Member

Choose a reason for hiding this comment

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

This is reiterated #1958 (comment) but I do not understand the answer.

return
}
klog.V(2).Infof("Retrieved the version from image configuration in the image to extract: %s", v)
versionInImageConfig = v
Copy link
Member

Choose a reason for hiding this comment

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

We assume we never reach this place twice here (= we assume the callback is never called multiple time in a way that reaches this assignment) otherwise the old value is overwritten.

That assumption may be fine but I'd either add a comment here about it or logged if we reach here while versionInImageConfig is not empty.

@@ -349,6 +349,28 @@ func (o *ExtractOptions) Run(ctx context.Context) error {
}
}

// versionInImageConfig stores the version from the label of the image
// At the moment it is used later only for the logging purpose and thus is not blocking if failures occur upon getting its value
Copy link
Member

Choose a reason for hiding this comment

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

If the errors are not blocking then maybe they should be logged as warnings, not errors?

Copy link
Contributor

openshift-ci bot commented Jul 16, 2025

@hongkailiu: The following tests 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-aws-ovn-serial-1of2 7056f53 link true /test e2e-aws-ovn-serial-1of2
ci/prow/e2e-aws-ovn-serial-2of2 7056f53 link true /test e2e-aws-ovn-serial-2of2

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants