Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nieomylnieja committed Apr 15, 2024
1 parent e352c26 commit cc06367
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 101 deletions.
9 changes: 9 additions & 0 deletions internal/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package internal
import (
_ "embed"
"fmt"
"reflect"

"github.com/spf13/cobra"

Expand Down Expand Up @@ -79,6 +80,14 @@ func (a ApplyCmd) Run(cmd *cobra.Command) error {
if err != nil {
return err
}
for _, obj := range objects {
if obj.GetKind() == manifest.KindSLO {
type M = map[string]interface{}
type L = []interface{}
target := obj.(v1alpha.GenericObject)["spec"].(M)["objectives"].(L)[0].(M)["target"]
fmt.Println(reflect.TypeOf(target).Name())
}
}
printSourcesDetails("Applying", objects)
if err = a.client.Objects().V1().Apply(cmd.Context(), objects); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion test/delete-by-name.bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# bats file_tags=e2e
# bats file_tags=bats:focus,e2e

# setup_file is run only once for the whole file.
setup_file() {
Expand Down
10 changes: 0 additions & 10 deletions test/inputs/delete-by-name/agent.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions test/inputs/delete-by-name/alertmethod.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions test/inputs/delete-by-name/alertpolicy.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions test/inputs/delete-by-name/alertsilence.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions test/inputs/delete-by-name/annotation.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions test/inputs/delete-by-name/direct.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions test/inputs/delete-by-name/project.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions test/inputs/delete-by-name/rolebinding.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions test/inputs/delete-by-name/service.yaml

This file was deleted.

0 comments on commit cc06367

Please sign in to comment.