From 5d3fff288dfe0b7b2a80d5befcd9acfdef8d7a73 Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:27:59 +0300 Subject: [PATCH 1/8] chore: bump duty to v1.0.725 (#1546) --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index c09ef9bd..837d78ae 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,8 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.724 - github.com/flanksource/gomplate/v3 v3.24.38 + github.com/flanksource/duty v1.0.725 + github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 github.com/google/cel-go v0.21.0 @@ -129,7 +129,7 @@ require ( github.com/exaring/otelpgx v0.6.2 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/flanksource/is-healthy v1.0.34 // indirect + github.com/flanksource/is-healthy v1.0.35 // indirect github.com/flanksource/kommons v0.31.4 // indirect github.com/flanksource/kubectl-neat v1.0.4 // indirect github.com/fluxcd/gitkit v0.6.0 // indirect diff --git a/go.sum b/go.sum index fbdbe766..66f0331e 100644 --- a/go.sum +++ b/go.sum @@ -877,14 +877,14 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.724 h1:vHD2n/y5zh8kmOtOx0HDgnVqAN1KehH528Rjfs3/NSQ= -github.com/flanksource/duty v1.0.724/go.mod h1:kIfncz/CfAYbiTaSOy8U2OLikTOb5vIjZu3YPzMJpwQ= +github.com/flanksource/duty v1.0.725 h1:1KmqXdBz4KiivoUElBGhf9eGTFtvKyAZ+tX0iaN4d/0= +github.com/flanksource/duty v1.0.725/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= -github.com/flanksource/gomplate/v3 v3.24.38 h1:Fe1RhKfRi2N6pFvSl5VhH5DOLBxKYus+TVWB4uma87Q= -github.com/flanksource/gomplate/v3 v3.24.38/go.mod h1:u5g/jNouGVdJgJbACkzMxgdcCMk19uolcW5TDclvFC0= +github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= +github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8= github.com/flanksource/is-healthy v0.0.0-20230705092916-3b4cf510c5fc/go.mod h1:4pQhmF+TnVqJroQKY8wSnSp+T18oLson6YQ2M0qPHfQ= -github.com/flanksource/is-healthy v1.0.34 h1:7jMnhqNlZIpzA4PzgeZ2mabk5slraTq5ksjItf7QmPs= -github.com/flanksource/is-healthy v1.0.34/go.mod h1:eRPXZShZqaz3Mz+QeoCNbL3857lt9BgCt67jOUQXLOU= +github.com/flanksource/is-healthy v1.0.35 h1:hP6pVrc/lzDbTlms0aTIh0TcriCdQb9r+mivn45Bh30= +github.com/flanksource/is-healthy v1.0.35/go.mod h1:eRPXZShZqaz3Mz+QeoCNbL3857lt9BgCt67jOUQXLOU= github.com/flanksource/kommons v0.31.4 h1:zksAgYjZuwPgS8XTejDIWEYB0nPSU1i3Jxcavm/vovI= github.com/flanksource/kommons v0.31.4/go.mod h1:70BPMzjTvejsqRyVyAm/ZCeZ176toCvauaZjU03svnE= github.com/flanksource/kopper v1.0.10 h1:we6rnFj6sT7T9PH6+V0m7vJ6ywPqiq8Bx7iFofB78v4= From de47fb22d9c48f54b3f9d46303a7d0650b9b2ea9 Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:24:14 +0300 Subject: [PATCH 2/8] chore: bump is-healthy to v1.0.35 (#1545) Co-authored-by: moshloop <1489660+moshloop@users.noreply.github.com> From 20b3250fb9ee062328906e1937e14bac3a6223bf Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:26:54 +0300 Subject: [PATCH 3/8] chore: bump duty to v1.0.726 (#1547) Co-authored-by: adityathebe <13419481+adityathebe@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 837d78ae..f48fb0e7 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.725 + github.com/flanksource/duty v1.0.726 github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 diff --git a/go.sum b/go.sum index 66f0331e..30132aae 100644 --- a/go.sum +++ b/go.sum @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.725 h1:1KmqXdBz4KiivoUElBGhf9eGTFtvKyAZ+tX0iaN4d/0= -github.com/flanksource/duty v1.0.725/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= +github.com/flanksource/duty v1.0.726 h1:PVDZgR8xIx64BXTOAvyyVIrPE1LFWI7/E4xv7fzGkPQ= +github.com/flanksource/duty v1.0.726/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8= From 941bd320d6faf07b4d32a624c0535277fa21d19f Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:29:09 +0300 Subject: [PATCH 4/8] chore: bump duty to v1.0.727 (#1551) Co-authored-by: adityathebe <13419481+adityathebe@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f48fb0e7..889e1e28 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.726 + github.com/flanksource/duty v1.0.727 github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 diff --git a/go.sum b/go.sum index 30132aae..dba22981 100644 --- a/go.sum +++ b/go.sum @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.726 h1:PVDZgR8xIx64BXTOAvyyVIrPE1LFWI7/E4xv7fzGkPQ= -github.com/flanksource/duty v1.0.726/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= +github.com/flanksource/duty v1.0.727 h1:5f7mntZjtg4bvVCzLdIe2cwT8DnFtKYToq1H74T7tfo= +github.com/flanksource/duty v1.0.727/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8= From 63d36c0870818be7baab0bafa2c43db3f83771ea Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:49:56 +0300 Subject: [PATCH 5/8] chore: bump duty to v1.0.729 (#1554) Co-authored-by: moshloop <1489660+moshloop@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 889e1e28..563b1168 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.727 + github.com/flanksource/duty v1.0.729 github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 diff --git a/go.sum b/go.sum index dba22981..23d6c42d 100644 --- a/go.sum +++ b/go.sum @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.727 h1:5f7mntZjtg4bvVCzLdIe2cwT8DnFtKYToq1H74T7tfo= -github.com/flanksource/duty v1.0.727/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= +github.com/flanksource/duty v1.0.729 h1:4evnQNQBA/0Xa+cHi2Wet0EEtiCNaXfKVngyd/PG3nE= +github.com/flanksource/duty v1.0.729/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8= From b351c7f049ae1c927b0ae500b51768c7c9822c2e Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Fri, 25 Oct 2024 12:03:55 +0530 Subject: [PATCH 6/8] chore(playbook): handle multiple yamls from cmdline --- cmd/playbook.go | 2 +- playbook/playbook.go | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cmd/playbook.go b/cmd/playbook.go index 4d8eee08..51a09825 100644 --- a/cmd/playbook.go +++ b/cmd/playbook.go @@ -69,7 +69,7 @@ func parsePlaybookArgs(ctx context.Context, args []string) (*models.Playbook, *p } if f, err := os.Open(paramFile); err == nil { - if err := yamlutil.NewYAMLOrJSONDecoder(f, 1024).Decode(¶ms); err != nil { + if err := yamlutil.NewYAMLOrJSONDecoder(f, 1024).Decode(¶ms.Params); err != nil { return nil, nil, err } } diff --git a/playbook/playbook.go b/playbook/playbook.go index 873118e8..295d4a73 100644 --- a/playbook/playbook.go +++ b/playbook/playbook.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "os" + "strings" "github.com/flanksource/commons/collections" "github.com/flanksource/commons/logger" @@ -67,9 +68,21 @@ func CreateOrSaveFromFile(ctx context.Context, file string) (*models.Playbook, e return nil, err } - err = yamlutil.Unmarshal(manifest, &spec) - if err != nil { - return nil, err + // We can get multiple yamls, we choose first non empty, else throw an error + allManifests := strings.Split(string(manifest), "---") + for _, m := range allManifests { + err = yamlutil.Unmarshal([]byte(m), &spec) + if err != nil { + return nil, err + } + + if spec.Name == "" { + logger.Infof("[Skipping] Got empty name for spec %s", m) + continue + } + } + if spec.Name == "" { + return nil, fmt.Errorf("Error no name in spec %v", spec) } return db.SavePlaybook(ctx, &spec) From 2d0c9ac38798f4a262b28b990ecb1c3bf5e9f6f3 Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:17:52 +0300 Subject: [PATCH 7/8] chore: bump duty to v1.0.730 (#1555) Co-authored-by: moshloop <1489660+moshloop@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 563b1168..90feaf56 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.729 + github.com/flanksource/duty v1.0.730 github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 diff --git a/go.sum b/go.sum index 23d6c42d..b17184dd 100644 --- a/go.sum +++ b/go.sum @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.729 h1:4evnQNQBA/0Xa+cHi2Wet0EEtiCNaXfKVngyd/PG3nE= -github.com/flanksource/duty v1.0.729/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= +github.com/flanksource/duty v1.0.730 h1:Kbuk2HHMFq8saucPZBqALNKxSY8Hwa6LKIB2pBRfGYc= +github.com/flanksource/duty v1.0.730/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8= From 26d307d5fc8de0f4b21ce6144de8df4504c28b33 Mon Sep 17 00:00:00 2001 From: flankbot <65345839+flankbot@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:42:51 +0300 Subject: [PATCH 8/8] chore: bump duty to v1.0.731 (#1556) Co-authored-by: moshloop <1489660+moshloop@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 90feaf56..6b139e3a 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/fergusstrange/embedded-postgres v1.25.0 // indirect github.com/flanksource/commons v1.29.10 - github.com/flanksource/duty v1.0.730 + github.com/flanksource/duty v1.0.731 github.com/flanksource/gomplate/v3 v3.24.39 github.com/flanksource/kopper v1.0.10 github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2 diff --git a/go.sum b/go.sum index b17184dd..61cb9788 100644 --- a/go.sum +++ b/go.sum @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70= github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ= github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU= -github.com/flanksource/duty v1.0.730 h1:Kbuk2HHMFq8saucPZBqALNKxSY8Hwa6LKIB2pBRfGYc= -github.com/flanksource/duty v1.0.730/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= +github.com/flanksource/duty v1.0.731 h1:aV3BicPMi2uK/Q7ZKBTakNKIv2uC+9EWQ/F1WOcazr4= +github.com/flanksource/duty v1.0.731/go.mod h1:sZY2NytdenrkqXoMD6Gn2C8xH6dm5HsqOeE0p74Z2VE= github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc= github.com/flanksource/gomplate/v3 v3.24.39 h1:O763lnNIcTELSMYeIO0dNDfcb3LoZvzU1fr62I4Yxqg= github.com/flanksource/gomplate/v3 v3.24.39/go.mod h1:0wY/+UPvd7CxmiTBNmzZdWIEOUZAsRkpGY1j5R711O8=