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

Fix pseudo git HTTP urls broken since 59c82659 #4453

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

sylr
Copy link
Contributor

@sylr sylr commented Feb 5, 2022

Simple fix to restore the broken feature of pseudo git HTTP URLS (i.e.: https://github.com/org/repo.git//path/within/repo).

However, I believe the whole resource loading deserves a serious overhaul and each possible way of loading resources should have its own Loader. For example I think the fileLoader should only handle absolute and relative paths, not HTTP URLs like it does now.

Relates to #4030.

Signed-off-by: Sylvain Rabot sylvain@abstraction.fr

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 5, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @sylr. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 5, 2022
@thatsmydoing
Copy link
Contributor

Unfortunately, this does not work as it now breaks urls like in your initial PR

resources:
  - https://github.com/fluxcd/helm-controller/releases/download/v0.14.0/helm-controller.crds.yaml

However, I believe the whole resource loading deserves a serious overhaul and each possible way of loading resources should have its own Loader. For example I think the fileLoader should only handle absolute and relative paths, not HTTP URLs like it does now.

I agree but I believe to get there we have to get the kustomize team to decide on what url formats they actually support so that we can add full test cases to ensure that we don't break anything as we move towards it. I was hoping #4030 would trigger a discussion on this but it doesn't seem like there's much interest.

@sylr
Copy link
Contributor Author

sylr commented Feb 5, 2022

Unfortunately, this does not work as it now breaks urls like in your initial PR

🤦 I wouldn't have guessed that any github url would be considered as a valid git repository.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
@sylr
Copy link
Contributor Author

sylr commented Feb 5, 2022

Ok, I pushed something that should work.

Finally, I think I hate it.

@sylr sylr marked this pull request as draft February 5, 2022 19:55
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 5, 2022
@sylr
Copy link
Contributor Author

sylr commented Feb 7, 2022

@natasha41575
Copy link
Contributor

Ok so my take on this is to stop accepting valid HTTP(s) URL as possible Pseudo GIT URL and use the already implemented git:: prefix

That is something we can discuss in the future but we are not ready to do a major version bump with backwards breaking changes. Thank you for making this PR, will review when I can.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 7, 2022
@natasha41575 natasha41575 marked this pull request as ready for review February 7, 2022 18:01
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 7, 2022
@natasha41575
Copy link
Contributor

natasha41575 commented Feb 8, 2022

However, I believe the whole resource loading deserves a serious overhaul and each possible way of loading resources should have its own Loader. For example I think the fileLoader should only handle absolute and relative paths, not HTTP URLs like it does now.

You can file a tracking issue with this proposal if you'd like. I think your proposal is fine and we can take a look at a PR that does this, but we should first fix the regression and release this week.

For this PR, please add a test to confirm that it works for the URL in #4455.

You can add this test to https://github.com/kubernetes-sigs/kustomize/blob/master/api/krusty/remoteload_test.go, see TestRemoteResource as an example. Let's try to get this in tomorrow, I'll release the patch on Thursday.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
@k8s-ci-robot
Copy link
Contributor

@sylr: This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 9, 2022
@natasha41575 natasha41575 added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Feb 9, 2022
@natasha41575
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 9, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natasha41575, sylr

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 9, 2022
@k8s-ci-robot k8s-ci-robot merged commit 2f17803 into kubernetes-sigs:master Feb 9, 2022
@natasha41575
Copy link
Contributor

Thanks for the quick fix!

@sylr
Copy link
Contributor Author

sylr commented Feb 10, 2022

Thanks for the quick fix!

No worries, that was the least I could do.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants