-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
Signed-off-by: Ganesh Maharaj Mahalingam <gmmaharaj@gmail.com>
I had a play around with this this morning and I still can't get it to work, I mean ccloudvm create still fails with go1.16. I think this commit is probably fine but we need something else as well to get things working. At this stage I think we need to stop using the GOPATH to locate the workloads. Perhaps we can copy them to a location that the systemd service can find when one does a ccloudvm create. We already look in ~/.ccloudvm/workloads so we could just copy them in there. I need a bit more time to fix this. |
Of course the problem is, how can we copy them if we can't find them? Perhaps we could just embed them into the binary. This would add an extra step when adding a workload. |
@ganeshmaharaj In the meantime you can get things to work by copying the workload you want into ~/.ccloudvm/workloads. If you do this the code that uses the GOPATH which no longer works, won't get called. |
@markdryan with this patch and setting GO111MODULE to be auto
The output of the test is
I am still not sure why go will not fall back to the default src path for searching. I also tried switching over to |
I think that code is just inherently fragile and we should just remove it. I can merge this MR now as I have confirm that it does build. |
Although maybe I'll wait until I have a full fix. I can push the updates to this PR I think. The README will need to be updated as well. |
@@ -41,6 +42,10 @@ import ( | |||
|
|||
const ccloudvmPkg = "github.com/intel/ccloudvm" | |||
|
|||
//go:embed "workloads/*" | |||
var wkldfs embed.FS | |||
var allwklds, _ = fs.ReadDir(wkldfs, "workloads") |
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.
Great. So no need to ever update this.
The previous method of searching for workload files in the source-tree is broken with new go versions as GOPATH is getting deprecated. Migrating to embed to hold all workload yamls in the binary and feed from there. Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
16571fa
to
21626f6
Compare
Signed-off-by: Ganesh Maharaj Mahalingam <gmmaharaj@gmail.com>
No description provided.