Closed cbruno10 closed 1 year ago
I just ran into this issue as well.
I fixed it by removing the mod repo directory, cd'ing to my home directory and re-installing the mod and then steampipe instead downloaded the module and installed it to ~/.steampipe/mods
.
This error occured becase I did sp mod install github.com/turbot/steampipe-mod-aws-insights
while I was inside the repo that I downloaded to my repos directory, steampipe-mod-aws-insights
.
When there's a plugin
block in the require
block, the update from mod install
or mod uninstall
corrupts the mod.sp
file.
Example:
Starting withe the following mod.sp
:
mod "local" {
title = "modtest"
require {
mod "github.com/pskrbasu/steampipe-mod-dependency-vars-1" {
version = "*"
}
mod "github.com/pskrbasu/steampipe-mod-m4" {
version = "*"
}
plugin "aws" {
version = "0.86.0"
}
}
}
Running steampipe mod uninstall github.com/pskrbasu/steampipe-mod-m4
corrupts the mod.sp
file and leaves behind the following:
mod "local" {
title = "modtest"
require {
plugins = [""]
mod "github.com/pskrbasu/steampipe-mod-dependency-vars-1" {
version = "*"
}
}
}
Trying to run steampipe with the corrupt mod.sp
results in a fatal error with the message:
Error: failed to load mod definition: Failed to load mod:
Unsupported argument: An argument named "plugins" is not expected here.
(/Users/binaek/modtest/mod.sp:5,5-12)
Variables set on mod
requires are not retained after mod install
after running steampipe mod uninstall github.com/pskrbasu/steampipe-mod-m4
Describe the bug If I have a
mod.sp
in a dir:If I run
steampipe mod install github.com/turbot/steampipe-mod-aws-compliance
, it changes mymod.sp
to:Notably, the
documentation
has changed and underrequire
, myplugin
was removed and now it hasplugins = [""]
Steampipe version (
steampipe -v
) v0.19.3To reproduce See steps above
Expected behavior The
documentation
field should not change and theplugins
field should not change either.Additional context Add any other context about the problem here.