Skip to content

Commit

Permalink
Fix manifest parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentluce committed Jul 10, 2024
1 parent 332f2c5 commit 2714cbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kardinal-cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.Ser
manifest := string(fileBytes)
// TODO: Check format of manifest file
blocks := strings.Split(manifest, "---")
serviceConfigs := make([]api_types.ServiceConfig, len(blocks))
if len(blocks) % 2 != 0 {
return nil, stacktrace.NewError("The manifest should contain pairs of service / deployment specifications")
}
serviceConfigs := make([]api_types.ServiceConfig, len(blocks) / 2)
decode := scheme.Codecs.UniversalDeserializer().Decode
for index, spec := range strings.Split(manifest, "---") {
if len(spec) == 0 {
Expand Down

0 comments on commit 2714cbe

Please sign in to comment.