Skip to content

USHIFT-852: assets.yaml declaring manifests to copy from releases#1347

Merged
openshift-merge-robot merged 7 commits intoopenshift:mainfrom
pmtk:rebase/recipe
Feb 14, 2023
Merged

USHIFT-852: assets.yaml declaring manifests to copy from releases#1347
openshift-merge-robot merged 7 commits intoopenshift:mainfrom
pmtk:rebase/recipe

Conversation

@pmtk
Copy link
Member

@pmtk pmtk commented Feb 9, 2023

Adds asset.yaml that lists all the files in assets/. Focused only on sourcing the assets (either copying from STAGING_DIR or using git restore). It does not include any modifications (like yq) to the manifests (yet).
Its purpose is to have common place for both rebase procedure and rebase presubmit.

Introduces new way of copying manifests from staging dir based on contents of assets.yaml file.
Commands such as cp, git restore, rm -rf are removed from rebase.sh's functions dealing with manifests (assets/).

Other changes include:

  • wrapping {{ .template }} inside quotes to get correct yaml file, so many sed commands are removed
  • formatting lvms/topolvm manifests with oc create --dry-run=client (includes sorting) (a consequence of using oc create --dry-run on all lvms/topolvm manifests, not just the copied ones)
  • changing method of creating "lvmd" ConfigMap from templating to overriding ConfigMap's data (because templating "{{ .lvmd }}" would keep the " resulting in incorrect data)
  • removed Test_renderLvmdConfig because it was testing approach based on renderTemplate() which is no longer used

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 9, 2023

@pmtk: This pull request references USHIFT-852 which is a valid jira issue.

Details

In response to this:

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 9, 2023
@openshift-ci openshift-ci bot requested review from dhellmann and ggiguash February 9, 2023 17:19
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 9, 2023
@ggiguash
Copy link
Contributor

/retest

@pmtk, can you add the fix description to the PR? There seem to be some formatting changes, so it's not clear what needs to be reviewed.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 10, 2023

@pmtk: This pull request references USHIFT-852 which is a valid jira issue.

Details

In response to this:

Adds asset.yaml that lists all the files in assets/. Focused only on sourcing the assets (either copying from STAGING_DIR or using git restore). It does not include any modifications (like yq) to the manifests (yet).
Its purpose is to have common place for both rebase procedure and rebase presubmit.

Introduces new way of copying manifests from staging dir based on contents of assets.yaml file.
Commands such as cp, git restore, rm -rf are removed from rebase.sh's functions dealing with manifests (assets/).

Other changes include:

  • wrapping {{ .template }} inside quotes to get correct yaml file
  • formatting lvms manifests with oc create --dry-run=client (includes sorting)
  • changing method of creating "lvmd" ConfigMap from templating to overriding ConfigMap's data
  • removed Test_renderLvmdConfig because it was testing approach based on renderTemplate() which is no longer used

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 10, 2023

@pmtk: This pull request references USHIFT-852 which is a valid jira issue.

Details

In response to this:

Adds asset.yaml that lists all the files in assets/. Focused only on sourcing the assets (either copying from STAGING_DIR or using git restore). It does not include any modifications (like yq) to the manifests (yet).
Its purpose is to have common place for both rebase procedure and rebase presubmit.

Introduces new way of copying manifests from staging dir based on contents of assets.yaml file.
Commands such as cp, git restore, rm -rf are removed from rebase.sh's functions dealing with manifests (assets/).

Other changes include:

  • wrapping {{ .template }} inside quotes to get correct yaml file, so many sed commands are removed
  • formatting lvms/topolvm manifests with oc create --dry-run=client (includes sorting) (a consequence of using oc create --dry-run on all lvms/topolvm manifests, not just the copied ones)
  • changing method of creating "lvmd" ConfigMap from templating to overriding ConfigMap's data (because templating "{{ .lvmd }}" would keep the " resulting in incorrect data)
  • removed Test_renderLvmdConfig because it was testing approach based on renderTemplate() which is no longer used

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.

@pmtk
Copy link
Member Author

pmtk commented Feb 10, 2023

@pmtk, can you add the fix description to the PR? There seem to be some formatting changes, so it's not clear what needs to be reviewed.

I copied (and slightly tweaked) descriptions from individual commits

@pmtk
Copy link
Member Author

pmtk commented Feb 10, 2023

/cc @copejon
PTAL on the lvms/topolvm related changes

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

I like the direction this is going.

Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed it because it was testing if the ConfigMap is properly templated ({{ .lvmd }}) but now it's substituted so this test didn't made much sense:

# pkg/components/storage.go
-	if err := assets.ApplyConfigMaps(cm, renderTemplate, lvmdRenderParams, kubeconfigPath); err != nil {
+	if err := assets.ApplyConfigMapWithData(cm, map[string]string{"lvmd.yaml": lvmdRenderParams["lvmd"].(string)}, kubeconfigPath); err != nil {

I think, if we'd want to test something, it would be assets.ApplyConfigMapWithData() (although I think it would need a refactor to split this logic from applying it to API)

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, it makes sense to remove this. We can add other tests in separate PRs if we want them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if 'no_clean' in dir and dir['no_clean']:
if dir.get('no_clean', False):

Copy link
Member Author

Choose a reason for hiding this comment

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

nice! thx

Comment on lines 104 to 105
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if "files" in dir:
for f in dir['files']:
for f in dir.get('files', []):

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be the same as for files.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@pmtk pmtk force-pushed the rebase/recipe branch 2 times, most recently from f3edc57 to 2976005 Compare February 13, 2023 13:57
@pmtk
Copy link
Member Author

pmtk commented Feb 13, 2023

/test e2e-reboot

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

When I tried to run this version of the rebase script it replaced some of the assets with "Script exited with error.". Maybe you can prepare a separate PR showing the output of this work?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, it makes sense to remove this. We can add other tests in separate PRs if we want them.

@dhellmann
Copy link
Contributor

When I tried to run this version of the rebase script it replaced some of the assets with "Script exited with error.". Maybe you can prepare a separate PR showing the output of this work?

It looks like that's the same problem with oc requiring credentials that we've discussed elsewhere.

@pmtk
Copy link
Member Author

pmtk commented Feb 14, 2023

When I tried to run this version of the rebase script it replaced some of the assets with "Script exited with error.". Maybe you can prepare a separate PR showing the output of this work?

Sure.
I ran contents of #1362 last_rebase.sh on this branch.
Here's the branch it produced: https://github.com/pmtk/microshift/tree/rebase-4.13.0-0.nightly_amd64-2023-02-13-194759_arm64-2023-02-14-014641 I created PR against rebase branch: #1365 although the diff is weird because it shows the same changes like it would be against main branch

Here's PR between today's rebase PR and same refs produced by this branch #1367 (although the diff looks like it's against main, maybe if I'd rebase my branch on top of CI PR branch the diff would be "correct" - but you can see same changes with some reformatting).

Edit2: Here's PR between 1362 and 1367 rebased on top of 1362: #1368

@dhellmann
Copy link
Contributor

When I tried to run this version of the rebase script it replaced some of the assets with "Script exited with error.". Maybe you can prepare a separate PR showing the output of this work?

Sure. I ran contents of #1362 last_rebase.sh on this branch. Here's the branch it produced: https://github.com/pmtk/microshift/tree/rebase-4.13.0-0.nightly_amd64-2023-02-13-194759_arm64-2023-02-14-014641 I created PR against rebase branch: #1365 although the diff is weird because it shows the same changes like it would be against main branch

Here's PR between today's rebase PR and same refs produced by this branch #1367 (although the diff looks like it's against main, maybe if I'd rebase my branch on top of CI PR branch the diff would be "correct" - but you can see same changes with some reformatting).

Edit2: Here's PR between 1362 and 1367 rebased on top of 1362: #1368

OK, that all looks good. This needs a rebase, but then I'll LGTM it.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2023
pmtk added 4 commits February 14, 2023 17:04
asset.yaml that lists all the files in assets/.
It does not include any modifications to the manifests.
Focused only on sourcing the assets (either copying from
STAGING_DIR or using git restore).

Its purpose is to have common place for both rebase procedure
and rebase presubmit.
introduces new way of copying manifests from staging dir
based on contents of assets.yaml file
changes include:
- wrapping {{ .template  }} inside quotes to get correct yaml file
- formatting lvms manifests with `oc create --dry-run=client`
  (includes sorting)
- changing method of creating "lvmd" ConfigMap from templating to
  overriding ConfigMap's data
pmtk added 3 commits February 14, 2023 17:04
removed Test_renderLvmdConfig because it was
testing approach based on renderTemplate()
which is no longer used
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2023
@dhellmann
Copy link
Contributor

/retest

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

/lgtm

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

openshift-ci bot commented Feb 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhellmann, pmtk

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

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.

5 participants