-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove symlink to crd file in kubernetes e2e test data #10388
Conversation
Issues linked to changelog: |
@@ -15,9 +15,12 @@ import ( | |||
) | |||
|
|||
var ( | |||
// This is fragile, but symlinks don't work when the tests are imported to another repo, and its better than duplicating the file | |||
repoRoot = filepath.Join(util.MustGetThisDir(), "..", "..", "..", "..", "..", "..") |
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.
settingsFixturesFolder := filepath.Join(util.GetModuleRoot(), "install", "test", "fixtures", "settings") |
Can we use GetModuleRoot instead?
Alternatively, we could define a method in the crds/ package that returns the full path to a file, and then call it here. that way the functionalty lives in the package itself and others can use
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.
That does not work when imported into solo-projects
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.
hmm, and what I tried was GetGoModule
not GetModuleRoot
, so let me try that too
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.
If we exposed a method in the crds package that usesd "GetThisDir/file-name", couldn't that work?
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.
That does work
Co-authored-by: Bernie Birnbaum <[email protected]>
Description
A symlink in the test data causes test failure/file-not-found when imported into
solo-projects
Code changes
Added
Directory()
to theprojects/gateway2/crds
package to provide a way to access the crd files.Removed symlink and updated
types.go
to point to the original file usingcrds.Directory()
Testing steps
Locally, test still passes:
Validated by pulling into solo-projects:
and running tests on an existing cluster:
With output:
Checklist: