-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: mark successful triggering of workflow even without any supported resources Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: engines entry Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: reduce code duplication Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: update codeowners Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: Azure cost PoC Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: log schema setup err Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: log usage err Signed-off-by: Azanul <azanulhaque@gmail.com> * fix: aws config env vars support Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: log schema setup err Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: separate create config Signed-off-by: Azanul <azanulhaque@gmail.com> * feat: use util to create config Signed-off-by: Azanul <azanulhaque@gmail.com> --------- Signed-off-by: Azanul <azanulhaque@gmail.com>
- Loading branch information
Showing
5 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package config | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/BurntSushi/toml" | ||
"github.com/tailwarden/komiser/models" | ||
) | ||
|
||
const DefaultFileName = "config.toml" | ||
|
||
var demoConfig = models.Config{ | ||
AWS: []models.AWSConfig{ | ||
{ | ||
Name: "Demo", | ||
Source: "CREDENTIALS_FILE", | ||
Profile: "default", | ||
}, | ||
}, | ||
SQLite: models.SQLiteConfig{ | ||
File: "komiser.db", | ||
}, | ||
} | ||
|
||
func Create(c *models.Config) error { | ||
if c == nil { | ||
c = &demoConfig | ||
} | ||
|
||
f, err := os.Create(DefaultFileName) | ||
if err != nil { | ||
return err | ||
} | ||
if err := toml.NewEncoder(f).Encode(*c); err != nil { | ||
return err | ||
} | ||
return f.Close() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters