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

DO NOT MERGE: minimal repro for origin annotation bug #4801

Closed
wants to merge 1 commit into from

Conversation

mightyguava
Copy link
Contributor

@mightyguava mightyguava commented Sep 17, 2022

Context: #4783 (comment)

I believe the root cause is this line

path = absPath[strings.Index(absPath[1:], "/")+1:][1:]
. This is where /notCloned is trimmed, but this only works if the kustomization is not at the repo root, and has a path.

=== RUN   TestRemoteResourceAnnoOriginFailing
    remoteload_test.go:62: 
        	Error Trace:	remoteload_test.go:62
        	            				remoteload_test.go:78
        	            				remoteload_test.go:412
        	Error:      	Not equal: 
        	            	expected: "apiVersion: v1\nkind: Pod\nmetadata:\n  annotations:\n    config.kubernetes.io/origin: |\n      repo: https://github.com/mightyguava/kustomize-bug.git\n      path: pod.yaml\n  labels:\n    app: myapp\n  name: myapp-pod\nspec:\n  containers:\n  - image: nginx:1.7.9\n    name: nginx\n"
        	            	actual  : "apiVersion: v1\nkind: Pod\nmetadata:\n  annotations:\n    config.kubernetes.io/origin: |\n      path: notCloned/pod.yaml\n      repo: https://github.com/mightyguava/kustomize-bug\n  labels:\n    app: myapp\n  name: myapp-pod\nspec:\n  containers:\n  - image: nginx:1.7.9\n    name: nginx\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -5,4 +5,4 @@
        	            	     config.kubernetes.io/origin: |
        	            	-      repo: https://github.com/mightyguava/kustomize-bug.git
        	            	-      path: pod.yaml
        	            	+      path: notCloned/pod.yaml
        	            	+      repo: https://github.com/mightyguava/kustomize-bug
        	            	   labels:
        	Test:       	TestRemoteResourceAnnoOriginFailing
--- FAIL: TestRemoteResourceAnnoOriginFailing (0.64s)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 17, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @mightyguava. 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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mightyguava
Once this PR has been reviewed and has the lgtm label, please assign natasha41575 for approval by writing /assign @natasha41575 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

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 17, 2022
@mightyguava mightyguava changed the title minimal repro for origin annotation bug DO NOT MERGE: minimal repro for origin annotation bug Sep 17, 2022
@mightyguava
Copy link
Contributor Author

Closing since the tests in #4783 already cover this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants