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

WIP: Temporary PR to share POC for CFE-538 / WRKLDS-456 #499

Closed
wants to merge 2 commits into from

Conversation

sherine-k
Copy link
Contributor

Sharing this PR in order to exchange with the oc-mirror + wrklds + olm teams.

This PR makes changes so that oc-mirror utility

  • creates a test func in operator_test.go (commented as it fails for now) to easily test the render
  • accepts Operator.Catalog containing oci: and treat them the same way as file:
  • tweaks the ref that is passed on to render (remove the file: from the ref, so that renderReference can understand we are refering to an image as a folder
  • Combined with the following change in WalkFS, we can see that the error reported is error: error rendering new refs: render reference "/home/skhoury/go/src/github.com/openshift/oc-mirror/rhopid": object '{"apiVersion":"mirror.openshift.io/v1alpha2","kind":"ImageSetConfiguration","mirror":{"additionalImages":[{"name":"registry.redhat.io/ubi8/ubi:latest"}],"helm":{},"operators":[{"catalog":"registry.redhat.io/redhat/redhat-operator-index:v4.11","packages":[{"channels":[{"name":"stable"}],"name":"serverless-operator"}]}],"platform":{"channels":[{"name":"stable-0.2","type":"ocp"}]}},"storageConfig":{"local":{"path":"./"}}}' is missing root schema field
versionFilename := "VERSION" // later to become const

	if root == nil {
		return fmt.Errorf("no declarative config filesystem provided")
	}

	matcher, err := ignore.NewMatcher(root, indexIgnoreFilename)
	if err != nil {
		return err
	}

	versionMatcher, err := ignore.NewMatcher(root, versionFilename)
	if err != nil {
		return err
	}

	return fs.WalkDir(root, ".", func(path string, info fs.DirEntry, err error) error {
		if err != nil {
			return walkFn(path, nil, err)
		}
		// avoid validating a directory, an .indexignore file, or any file that matches
		// an ignore pattern outlined in a .indexignore file.
		if info.IsDir() || info.Name() == indexIgnoreFilename || info.Name() == versionFilename || matcher.Match(path, false) || versionMatcher.Match(path, false) {
			return nil
		}

		cfg, err := LoadFile(root, path)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 9, 2022
@openshift-ci openshift-ci bot requested a review from afflom August 9, 2022 15:15
@openshift-ci
Copy link

openshift-ci bot commented Aug 9, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sherine-k
Once this PR has been reviewed and has the lgtm label, please assign soltysh for approval by writing /assign @soltysh in a comment. For more information see:The Kubernetes 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-ci
Copy link

openshift-ci bot commented Aug 9, 2022

@sherine-k: 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/sanity 15e82a7 link true /test sanity

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-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 8, 2022
@openshift-merge-robot
Copy link
Contributor

@sherine-k: PR needs rebase.

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.

@sherine-k sherine-k closed this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants