diff --git a/apps/cnspec/cmd/framework.go b/apps/cnspec/cmd/framework.go index 8cab1cb1..b056ba98 100644 --- a/apps/cnspec/cmd/framework.go +++ b/apps/cnspec/cmd/framework.go @@ -18,7 +18,6 @@ import ( "go.mondoo.com/cnspec/v11/policy" cnspec_upstream "go.mondoo.com/cnspec/v11/upstream" mondoogql "go.mondoo.com/mondoo-go" - "k8s.io/utils/ptr" ) const ( @@ -90,12 +89,12 @@ var frameworkListCmd = &cobra.Command{ return err } - state := ptr.To(mondoogql.ComplianceFrameworkStateActive) + states := []mondoogql.ComplianceFrameworkState{mondoogql.ComplianceFrameworkStateActive} if viper.GetBool("all") { - state = nil + states = []mondoogql.ComplianceFrameworkState{} } - frameworks, err = cnspec_upstream.ListFrameworks(context.Background(), mondooClient, opts.GetParentMrn(), state) + frameworks, err = cnspec_upstream.ListFrameworks(context.Background(), mondooClient, opts.GetParentMrn(), states) if err != nil { log.Error().Msgf("failed to list compliance frameworks: %s", err) os.Exit(1) diff --git a/upstream/framework.gql.go b/upstream/framework.gql.go index f5b1ac6d..9d100a9c 100644 --- a/upstream/framework.gql.go +++ b/upstream/framework.gql.go @@ -10,6 +10,7 @@ import ( "go.mondoo.com/cnspec/v11/policy" mondoogql "go.mondoo.com/mondoo-go" + "k8s.io/utils/ptr" "go.mondoo.com/cnquery/v11/providers-sdk/v1/upstream/gql" ) @@ -20,7 +21,7 @@ type UpstreamFramework struct { State mondoogql.ComplianceFrameworkState } -func ListFrameworks(ctx context.Context, c *gql.MondooClient, scopeMrn string, state *mondoogql.ComplianceFrameworkState) ([]*UpstreamFramework, error) { +func ListFrameworks(ctx context.Context, c *gql.MondooClient, scopeMrn string, states []mondoogql.ComplianceFrameworkState) ([]*UpstreamFramework, error) { var q struct { Frameworks []struct { Mrn string @@ -32,7 +33,7 @@ func ListFrameworks(ctx context.Context, c *gql.MondooClient, scopeMrn string, s err := c.Query(ctx, &q, map[string]any{ "input": mondoogql.ComplianceFrameworksInput{ ScopeMrn: mondoogql.String(scopeMrn), - State: state, + States: ptr.To(states), }, }) if err != nil {