-
Notifications
You must be signed in to change notification settings - Fork 220
NE-1269: Replace bindata using embed #905
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
NE-1269: Replace bindata using embed #905
Conversation
|
@Miciah: This pull request references NE-1269 which is a valid jira issue. DetailsIn 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. |
|
Lots of bootstrap failures. |
|
@Miciah: This pull request references NE-1269 which is a valid jira issue. DetailsIn 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. |
66d900e to
b977341
Compare
|
@Miciah: This pull request references NE-1269 which is a valid jira issue. DetailsIn 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. |
b977341 to
1a7236f
Compare
|
@Miciah: This pull request references NE-1269 which is a valid jira issue. DetailsIn 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. |
|
/assign @frobware |
1 similar comment
|
/assign @frobware |
pkg/manifests/manifests.go
Outdated
| //go:embed assets manifests | ||
| var content embed.FS | ||
|
|
||
| // MustAsset returns the bytes for the named assert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // MustAsset returns the bytes for the named assert. | |
| // MustAsset returns the bytes for the named asset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //go:generate cp ../../manifests/00-namespace.yaml manifests/ | ||
| //go:generate cp ../../manifests/00-custom-resource-definition.yaml manifests/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions. Why are these two files the only ones needed from the manifests/ directory? And why not permanently move them to assets/ instead of creating a temporary directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of questions. Why are these two files the only ones needed from the manifests/ directory?
They are the only two files that the ingress-operator render command uses:
cluster-ingress-operator/cmd/ingress-operator/render.go
Lines 42 to 45 in e93984f
| files := []string{ | |
| manifests.CustomResourceDefinitionManifest, | |
| manifests.NamespaceManifest, | |
| } |
#309 added the ingress-operator render command for the installer to use in openshift/installer#2523 for configuring ingresscontrollers at installation time.
And why not permanently move them to assets/ instead of creating a temporary directory?
Then they wouldn't be in the right place for CVO to read them. The manifests still need to be installed by CVO if the cluster admin doesn't configure them with the installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then they wouldn't be in the right place for CVO to read them. The manifests still need to be installed by CVO if the cluster admin doesn't configure them with the installer.
Seems like a worthwhile comment to add so that somebody doesn't move things in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3dafe96 to
d636984
Compare
|
https://github.com/openshift/cluster-ingress-operator/compare/3dafe96f29556f24a6cfdcd199b669681c83221b..d6369842170adf3e6927befe9e13a673d95f1c8b removes |
d636984 to
5fd4199
Compare
|
Rebased since #901 merged. |
|
/approve @candita deferring to you for the LGTM. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: frobware The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
|
This is a build change that doesn't require docs, PX, or QE. |
|
/lgtm |
e66f429 to
44b7bdc
Compare
|
Rebased for #932. |
|
/lgtm |
|
e2e-hypershift failed. e2e-aws-operator failed because must-gather failed. |
Replace go-bindata using the embed package added in Go 1.16. This change simplifies the build process and reduces the likelihood of merge conflicts when PRs modify assets. This commit resolves NE-1269. https://issues.redhat.com/browse/NE-1269 * .gitignore: Ignore the new, generated pkg/manifests/manifests/ directory. * Makefile: Delete "bindata" target. Add a "manifests" target to generate assets under pkg/manifests/ from the top-level manifests/ directory. Make the "generate" target depend on "manifests" instead of on "update". Make the "build", "test", "test-e2e", "test-e2e-list", and "verify" targets depend on "generate". Add a command to delete generated files under the "clean" target. * go.mod: Drop go-bindata. * go.sum: Regenerate. * hack/update-generated-bindata.sh: * hack/verify-generated-bindata.sh: Delete files. * assets/: Move from here... * pkg/manifests/assets/: ...to here. New directory. * pkg/manifests/bindata.go: Delete file. * pkg/manifests/manifests.go (content): New variable. Store assets as an embed.FS value. (MustAsset, MustAssetString): New functions. Return assets using the new content variable. These function definitions replace ones from the deleted bindata.go file. * pkg/manifests/manifests_test.go (TestManifests): Verify that the CustomResourceDefinitionManifest and NamespaceManifest assets can be read. * tools/tools.go: Delete file. We no longer need to import go-bindata. * vendor/*: Regenerate.
44b7bdc to
0b761da
Compare
|
Rebased for #900. |
|
/lgtm |
|
e2e-aws-operator failed because must-gather failed. e2e-azure-ovn failed because the installer's post-bootstrap cleanup failed: /test e2e-azure-ovn |
|
e2e-gcp-operator failed because |
|
e2e-azure-operator failed because the network operator reported degraded status: This appears to be the same issues as OCPBUGS-15945. |
|
@Miciah: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Replace go-bindata using the embed package added in Go 1.16. This change simplifies the build process and reduces the likelihood of merge conflicts when PRs modify assets.
.gitignore: Ignore the new, generatedpkg/manifests/manifests/directory.Makefile: Deletebindatatarget. Add amanifeststarget to generate assets underpkg/manifests/from the top-levelmanifests/directory. Make thegeneratetarget depend onmanifestsinstead of onupdate. Make thebuild,test,test-e2e,test-e2e-list, andverifytargets depend ongenerate. Add a command to delete generated files under thecleantarget.go.mod: Drop go-bindata.go.sum: Regenerate.hack/update-generated-bindata.sh: Delete file.assets/: Move from here...pkg/manifests/assets/: ...to here. New directory.pkg/manifests/bindata.go: Delete file.pkg/manifests/manifests.go(content): New variable. Store assets as anembed.FSvalue.(
MustAsset,MustAssetString): New functions. Return assets using the new content variable. These function definitions replace ones from the deletedbindata.gofile.pkg/manifests/manifests_test.go(TestManifests): Verify that theCustomResourceDefinitionManifestandNamespaceManifestassets can be read.tools/tools.go: Delete file. We no longer need to import go-bindata.vendor/*: Regenerate.