Skip to content

Commit

Permalink
Rely only on source cli parameter in conformance/walk
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
  • Loading branch information
dims committed Mar 2, 2024
1 parent f4b0115 commit 948d9ca
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions test/conformance/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,12 @@ func saveAllTestInfo(dataSet []*ConformanceData) {
}

func getConformanceData(targetFrame frame) (*ConformanceData, error) {
// TODO: This is terribly hacky. Why can't we rely on the --source flag in
// all cases? https://issues.k8s.io/123567
//
// Filenames may be in a couple special places, depending on if they were
// built dockerized or with the host go. We want to trim this prefix to
// produce portable relative paths.
containerGopath := "/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/"

root := *k8sPath
if !strings.HasSuffix(root, string(os.PathSeparator)) {
root += string(os.PathSeparator)
}

trimmedFile := strings.TrimPrefix(targetFrame.File, root)
trimmedFile = strings.TrimPrefix(trimmedFile, containerGopath)
targetFrame.File = trimmedFile

freader, err := os.Open(targetFrame.File)
Expand Down

0 comments on commit 948d9ca

Please sign in to comment.