"packages/git@git.gitsec.cn:baidan/nocobase.git" did not exist on "93f22eca51299fa364ded160758b08564d5ec5e4"
Unverified Commit ee670358 authored by Yishay Mendelsohn's avatar Yishay Mendelsohn Committed by GitHub
Browse files

Merge pull request #95 from datreeio/staging

staging
parents aa9d0a64 06e01f89
main 620-disable-spinner-when-detecting-runs-in-ci-to-avoid-messing-up-logs-with-spinner-etc 702-datree-not-working-in-our-air-gapped-environment 746-offline-mode-does-not-work 762-unexpected-yaml-validation-error-did-not-find-expected-indicator DAT-3422-brew-post-install DAT-3451-create-trigger-for-production-release-deployment DAT-3498-prettify-error-messages DAT-3504-pre-release-deployment DAT-3516-set-rules-table-with-a-fixed-size DAT-3753_detect-ci-env DAT-3759_datree_exec_helm_files_docs_link DAT-3759_fix_message_color_and_remove_space DAT-3784-create-yaml-schema-validation-command DAT-3786-simple-output-on-ci DAT-3793_implement_local_schema_validation_logic DAT-3808_report_cli_errors DAT-3815_prompt-helper-kustomize-test DAT-3821_create-token-clientid DAT-3842-add-policy-config-flag DAT-3842-policy-config-flag DAT-3843-create-schema-in-cli-for-policies.yaml-validation DAT-3845_add_offline_flag_in_config_yaml DAT-3873-helm-kustomize-msg-color DAT-3877-skip-k8s-validation DAT-3878_add_--no-record_flag DAT-3879_implement_resource_quotas_custom_keys DAT-3938_bug-fixes DAT-3938_extract-skipping-annotations-policy-check-flow DAT-3958_support_no_intetnet_connection_offline_local DAT-4003-isCi-query-param DAT-4011_evluation-duration DAT-4019_datree-test-validate-yaml-command DAT-4019_datree-validate-yaml-command DAT-4060_validate-yaml-send-result-data DAT-4065-fix-offline-mode DAT-4075-yml-validation-array DAT-4105-remove-validate-yaml DAT-4132-junit-output-fix-crash-invalid-configurations DAT-415-test-exit-code DAT-4341-create-a-new-default-policy-all-rules DAT-4389-verbose-support-all-output-formats DAT-4405-remove-travis-cicd-impl DAT-4427-cli-add-save-rendered-flag DAT-add-architecture-image ISSUE#222_add_developers_guide ISSUE#570_support_customResourceDefinition_kind ISSUE#573_support_JUnit_output_format ISSUE#638_support_schema_validation_in_offline_mode ISSUE#799_pre-commit_permission_denied_fix add-aws-cli add-kustomize-cmd-description add-kustomize-intro add-kustomize-support add-not-strict-flag add-v-tag-rc add_cluster_integration_submodule add_job_in_release_workflow_for_travis_polling add_offline_check_in_k8s_validator add_rego_support add_tests_to_fragile_areas_of_code adjust_error_message_for_k8s_schema_not_found adr-poc argo-rules argoproj auto-assign-workflow changelog_gen_file changelog_goreleaser changelog_latest_release changelog_permissions ci/add_docker_image_build cli_error_reporting_fixes codeowners custom_changelog cverule debug_save_read_default_rules_files default-schema-version delete-dockerignore dima-wrong docs docs-template downloads-badge error-misspelling-metadataname fix-CONTAINERS_MISSING_MEMORY_REQUEST_KEY fix-changelog-messages fix-homedir fix-prompt-message fix-properties-default-rules fix-semver-commits fix-type-in-default-rule fix-version-message-print-empty fix_defaultRules_test_files hadar-co-patch-1 helm-links ignore-main-in-commit-message-validation line-err logfile logo metadatarule minor_changes_to_policies_yaml_validation nsa-docs nsa-rules nsa-test-files offerings offline_mode_indenify_network_error_fix only-k8s-files-flag patch-1-resove-conflicts perf-files policy-config-description pre_commit_hook_with_datreeci prestoprule print_login_url_from_getPreRunData probe-rules readme-badge readme-contributors rebase_staging refactor_datree_kustomize_test refactor_datree_kustomize_test_2 refactors_in_printers release-worflow-wait release/0.14.1-test-yishay release/0.14.17-yishay-test-yishay release/0.14.18 release/0.14.20 release/0.14.26 release/0.14.29 release/0.14.33 release/0.14.36 release/0.14.46 release/0.14.49 release/0.14.62 release/0.14.85 release/0.14.87 release/0.14.90 release/0.14.91 release/0.14.92 release/0.14.93 release/0.14.95 release/0.15.0 release/0.15.16 release/0.15.18 release/0.15.19 release/0.15.21 release/0.15.22 release/0.15.5 release/0.15.51 release/0.15.52 release/1.0.1 release/1.0.15 release/1.0.6 release/1.1.10 release/1.1.14 release/1.1.17 release/1.1.2 release/1.1.20 release/1.1.22 release/1.1.4 release/1.1.5 release/1.1.6 release/1.2.0 release/1.2.10 release/1.2.2 release/1.2.9 release/1.3.0 release/1.3.2 release/1.3.4 release/1.3.5 release/1.4.0 release/1.4.10 release/1.4.13 release/1.4.17 release/1.4.19 release/1.4.20 release/1.4.22 release/1.4.26 release/1.4.28 release/1.4.3 release/1.4.30 release/1.4.32 release/1.4.33 release/1.4.35 release/1.4.37 release/1.4.4 release/1.5.0 release/1.5.15 release/1.5.16 release/1.5.17 release/1.5.19 release/1.5.2 release/1.5.20 release/1.5.25 release/1.5.29 release/1.5.3 release/1.5.30 release/1.5.35 release/1.5.36 release/1.5.37 release/1.5.7 release/1.5.9 release/1.6.0 release/1.6.12 release/1.6.13 release/1.6.14 release/1.6.16 release/1.6.18 release/1.6.19 release/1.6.23 release/1.6.24 release/1.6.25 release/1.6.26 release/1.6.27 release/1.6.28 release/1.6.29 release/1.6.32 release/1.6.33 release/1.6.36 release/1.6.37 release/1.6.40 release/1.6.42 release/1.6.44 release/1.6.46 release/1.6.48 release/1.6.6 release/1.7.1 release/1.7.3 release/1.8.0 release/1.8.1 remove-debug-log remove-homebrew-bottle report_execution_environment resty-client romanlab-patch-1 roy_test_branch running_test_on_non_k8s_yaml_files_with_--only-k8s-files_raises_an_error_#430 sample-policy sarif schemadir secretrules shimont-patch-1 skip-schema-validation-flag slack-button sort_failed_rules_by_uniqe_names staging staging_temp support-new-publish svg-logo temp test-refactor test_pre_commit_hook update-architecture-img update-docs update-hackaton-guide update-readme update_xcode_version_to_13.3_in_travis.yaml upload-install-scripts use_DI_to_get_config_home yishay-test 1.8.2-rc 1.8.1 1.8.1-rc 1.8.0 1.8.0-rc 1.7.3 1.7.3-rc 1.7.2-rc 1.7.1 1.7.1-rc 1.7.0-rc 1.6.49-rc 1.6.48 1.6.48-rc 1.6.47-rc 1.6.46 1.6.46-rc 1.6.45-rc 1.6.44 1.6.44-rc 1.6.43-rc 1.6.42 1.6.42-rc 1.6.41-rc 1.6.40 1.6.40-rc 1.6.39-rc 1.6.38-rc 1.6.37 1.6.37-rc 1.6.36 1.6.36-rc 1.6.35-rc 1.6.34-rc 1.6.33 1.6.33-rc 1.6.32 1.6.32-rc 1.6.31-rc 1.6.30-rc 1.6.29 1.6.29-rc 1.6.28 1.6.28-rc 1.6.27 1.6.27-rc 1.6.26 1.6.26-rc 1.6.25 1.6.25-rc 1.6.24 1.6.24-rc 1.6.23 1.6.23-rc 1.6.22-rc 1.6.21-rc 1.6.20-rc 1.6.19 1.6.19-rc 1.6.18 1.6.18-rc 1.6.17-rc 1.6.16 1.6.16-rc 1.6.15-rc 1.6.14 1.6.14-rc 1.6.13 1.6.13-rc 1.6.12 1.6.12-rc 1.6.11-rc 1.6.10-rc 1.6.9-rc 1.6.8-rc 1.6.7-rc 1.6.6 1.6.6-rc 1.6.5-rc 1.6.4-rc 1.6.3-rc 1.6.2-rc 1.6.1-rc 1.6.0 1.6.0-rc 1.5.38-rc 1.5.37 1.5.37-rc 1.5.36 1.5.36-rc 1.5.35 1.5.35-rc 1.5.34-rc 1.5.33-rc 1.5.32-rc 1.5.31-rc 1.5.30 1.5.30-rc 1.5.29 1.5.29-rc 1.5.28-rc 1.5.27-rc 1.5.26-rc 1.5.25 1.5.25-rc 1.5.24-rc 1.5.23-rc 1.5.22-rc 1.5.21-rc 1.5.20 1.5.20-rc 1.5.19 1.5.19-rc 1.5.18-rc 1.5.17 1.5.17-rc 1.5.16 1.5.16-rc 1.5.15 1.5.15-rc 1.5.14-rc 1.5.13-rc 1.5.12-rc 1.5.11-rc 1.5.10-rc 1.5.9 1.5.9-rc 1.5.8-rc 1.5.7 1.5.7-rc 1.5.6-rc 1.5.5-rc 1.5.4-rc 1.5.3 1.5.3-rc 1.5.2 1.5.2-rc 1.5.1-rc 1.5.0 1.5.0-rc 1.4.40-rc-dima-test 1.4.39-rc 1.4.38-rc 1.4.37 1.4.37-rc 1.4.36-rc 1.4.35 1.4.35-rc 1.4.34-rc 1.4.33 1.4.33-rc 1.4.32 1.4.32-rc 1.4.31-rc 1.4.30 1.4.30-rc 1.4.29-rc 1.4.28 1.4.28-rc 1.4.27-rc 1.4.26 1.4.26-rc 1.4.25-rc 1.4.24-rc 1.4.23-rc 1.4.22 1.4.22-rc 1.4.21-rc 1.4.20 1.4.20-rc 1.4.19 1.4.19-rc 1.4.18-rc 1.4.17 1.4.17-rc 1.4.16-rc 1.4.15-rc 1.4.14-rc 1.4.13 1.4.13-rc 1.4.12-rc 1.4.11-rc 1.4.10 1.4.10-rc 1.4.9-rc 1.4.8-rc 1.4.7-rc 1.4.6-rc 1.4.5-rc 1.4.4 1.4.4-rc 1.4.3 1.4.3-rc 1.4.2-rc 1.4.1-rc 1.4.0 1.4.0-rc 1.3.11-rc 1.3.10-rc 1.3.9-rc 1.3.8-rc 1.3.7-rc 1.3.6-rc 1.3.5 1.3.5-rc 1.3.4 1.3.4-rc 1.3.3-rc 1.3.2 1.3.2-rc 1.3.1-rc 1.3.0 1.3.0-rc 1.2.11-rc 1.2.10 1.2.10-rc 1.2.9 1.2.9-rc 1.2.8-rc 1.2.7-rc 1.2.6-rc 1.2.5-rc 1.2.4-rc 1.2.3-rc 1.2.2 1.2.2-rc 1.2.1-rc 1.2.0 1.2.0-rc 1.1.25-rc 1.1.24-rc 1.1.23-rc 1.1.22 1.1.22-rc 1.1.21-rc 1.1.20 1.1.20-rc 1.1.19-rc 1.1.18-rc 1.1.17 1.1.17-rc 1.1.16-rc 1.1.15-rc 1.1.14 1.1.14-rc 1.1.13-rc 1.1.12-rc 1.1.11-rc 1.1.10 1.1.10-rc 1.1.9-rc 1.1.8-rc 1.1.7-rc 1.1.6 1.1.6-rc 1.1.5 1.1.5-rc 1.1.4-rc 1.1.3-rc 1.1.2 1.1.2-rc 1.1.1-rc 1.1.0-rc 1.0.17-rc 1.0.16-rc 1.0.15 1.0.15-rc 1.0.14-rc 1.0.13-rc 1.0.12-rc 1.0.11-rc 1.0.10-yishay-rc 1.0.10-rc 1.0.9-rc 1.0.8-rc 1.0.7-rc 1.0.6 1.0.6-rc 1.0.5-rc 1.0.4-rc 1.0.3-rc 1.0.2-rc 1.0.1 1.0.1-rc 1.0.0-rc 0.16.19-rc 0.16.18-rc 0.16.17-rc 0.16.16-rc 0.16.15-rc 0.16.14-rc 0.16.13-rc 0.16.12-rc 0.16.11-rc 0.16.10-rc 0.16.9-rc 0.16.8-rc 0.16.7-rc 0.16.6-rc 0.16.5-rc 0.16.4-rc 0.16.3-rc 0.16.2-rc 0.16.1-rc 0.16.0-rc 0.15.53-rc 0.15.52 0.15.52-rc 0.15.51 0.15.51-rc 0.15.50-rc 0.15.49-rc 0.15.48 0.15.48-rc 0.15.47-rc 0.15.46-rc 0.15.45-rc 0.15.44-rc 0.15.43-rc 0.15.42-rc 0.15.41-rc 0.15.40-rc 0.15.39-rc 0.15.38-rc 0.15.37-rc 0.15.36-rc 0.15.35-rc 0.15.34-rc 0.15.33-rc 0.15.32-rc 0.15.31-rc 0.15.30-rc 0.15.29-rc 0.15.28-rc 0.15.27-rc 0.15.26-rc 0.15.25-rc 0.15.24-rc 0.15.23-rc 0.15.22 0.15.22-rc 0.15.21 0.15.21-rc 0.15.20-rc 0.15.19 0.15.19-rc 0.15.18 0.15.18-rc 0.15.17-rc 0.15.16 0.15.16-rc 0.15.15-rc 0.15.14-rc 0.15.13-rc 0.15.12-rc 0.15.11-rc 0.15.10-rc 0.15.9-rc 0.15.8 0.15.8-rc 0.15.7 0.15.7-rc 0.15.6-rc 0.15.5 0.15.5-rc 0.15.4-rc 0.15.3-rc 0.15.2-rc 0.15.1-rc 0.15.0 0.15.0-rc 0.14.143-rc-test-changelog 0.14.142-rc-test-changelog 0.14.141-rc-test-changelog 0.14.140-rc-test-changelog 0.14.139-rc-test-changelog 0.14.138-rc-test-changelog 0.14.137-rc-test-changelog 0.14.136-rc-test-changelog 0.14.135-rc-test-changelog 0.14.134-rc-test-changelog 0.14.133-rc-test-changelog 0.14.132-rc-test-changelog 0.14.131-rc-test-changelog 0.14.130-rc-test-changelog 0.14.129-rc-test-changelog 0.14.128-rc-test-changelog 0.14.127-rc-test-changelog 0.14.126-rc-test-changelog 0.14.125-rc-test-changelog 0.14.124-rc-test-changelog 0.14.123-rc-test-changelog 0.14.122-rc-test-changelog 0.14.121-rc-test-changelog 0.14.120-rc-test-changelog 0.14.119-rc-test-changelog 0.14.118-rc-test-changelog 0.14.117-rc-test-changelog 0.14.116-rc-test-changelog 0.14.115-rc 0.14.114-rc 0.14.113-rc-test-changelog 0.14.112-rc-test-changelog 0.14.111-rc-test-changelog 0.14.110-rc-test-changelog 0.14.109-rc-test-changelog 0.14.108-rc-test-changelog 0.14.107-rc-test-changelog 0.14.106-rc-test-changelog 0.14.105-rc-test-changelog 0.14.104-rc-test-changelog 0.14.103-rc-test-changelog 0.14.102-rc 0.14.102-rc-test-changelog 0.14.101-rc 0.14.101-rc-test-changelog 0.14.100-rc 0.14.100-rc-test-changelog 0.14.99-rc 0.14.99-rc-test-changelog 0.14.98-rc 0.14.98-rc-test-changelog 0.14.97-rc 0.14.97-rc-test-changelog 0.14.96-rc 0.14.96-rc-test-changelog 0.14.95 0.14.95-rc 0.14.95-rc-test-changelog 0.14.94-rc 0.14.94-rc-test-changelog 0.14.93 0.14.93-rc 0.14.93-rc-test-changelog 0.14.92-rc 0.14.92-rc-test-changelog 0.14.91-rc 0.14.91-rc-test-changelog 0.14.90 0.14.90-rc 0.14.90-rc-test-changelog 0.14.89-rc 0.14.89-rc-test-changelog 0.14.88-rc 0.14.88-rc-test-changelog 0.14.87 0.14.87-rc 0.14.86-rc 0.14.85 0.14.85-rc 0.14.84-rc 0.14.83-rc 0.14.82-rc 0.14.81-rc 0.14.80-rc 0.14.79-rc 0.14.78-rc 0.14.77-rc 0.14.76-rc 0.14.75-rc 0.14.74-rc 0.14.73-rc 0.14.72-rc 0.14.71 0.14.71-rc 0.14.70 0.14.70-rc 0.14.69 0.14.69-rc 0.14.68-rc 0.14.67-rc 0.14.66-rc 0.14.65-rc 0.14.64-rc 0.14.63-rc 0.14.62 0.14.62-rc 0.14.61-rc 0.14.60-rc 0.14.59-rc 0.14.58-rc 0.14.57-rc 0.14.56-rc 0.14.55-rc 0.14.54-rc 0.14.53-rc 0.14.52-rc 0.14.51-rc 0.14.50-rc 0.14.49 0.14.49-rc 0.14.48-rc 0.14.47-rc 0.14.46 0.14.46-rc 0.14.45-rc 0.14.44-rc 0.14.43-rc 0.14.42-rc 0.14.41-rc 0.14.40-rc 0.14.39-rc 0.14.38-rc 0.14.37-rc 0.14.36 0.14.36-rc 0.14.35-rc 0.14.34-rc 0.14.33 0.14.33-rc 0.14.32-rc 0.14.31-rc 0.14.30-rc 0.14.29 0.14.29-rc 0.14.28-rc 0.14.27-rc 0.14.26 0.14.26-rc 0.14.25-rc 0.14.24-rc 0.14.23-rc 0.14.22-rc 0.14.21-rc 0.14.20 0.14.20-rc 0.14.19-rc 0.14.18 0.14.18-staging 0.14.18-staging-test-yishay 0.14.18-rc 0.14.17 0.14.17-yishay-test-yishay 0.14.17-yishay-rc 0.14.17-staging 0.14.17-rc 0.14.16 0.14.16-staging 0.14.16-rc 0.14.15-staging 0.14.14-staging 0.14.13-staging 0.14.12-staging 0.14.11-staging 0.14.10-staging 0.14.9-staging 0.14.8-staging 0.14.7-staging 0.14.7-rc 0.14.6 0.14.6-staging 0.14.5-staging 0.14.5-rc 0.14.4 0.14.4-staging 0.14.3-staging 0.14.2 0.14.2-staging 0.14.2-rc 0.14.2-internal 0.14.1-test-yishay 0.14.1-staging 0.14.1-rc 0.14.0-staging 0.14.0-rc 0.13.7 0.13.7-staging 0.13.7-internal 0.13.6-staging 0.13.5-staging 0.13.4 0.13.4-staging 0.13.4-internal 0.13.3-staging 0.13.2 0.13.2-staging 0.13.2-internal 0.13.1-staging 0.13.0 0.13.0-staging 0.13.0-internal 0.12.1 0.12.1-staging 0.12.1-internal 0.12.0 0.12.0-staging 0.12.0-internal 0.11.0 0.11.0-staging 0.10.6-staging 0.10.5-staging 0.10.4-staging 0.10.3-staging 0.10.2-staging 0.10.1-staging 0.10.0 0.10.0-staging 0.9.4-internal 0.9.4-DAT-3420-remove-find-replace 0.9.3-internal 0.9.3-DAT-3420-remove-find-replace 0.9.2-yishay 0.9.2-DAT-3420-remove-find-replace 0.9.1-DAT-3420-remove-find-replace 0.9.0 0.9.0-temp 0.9.0-staging 0.9.0-internal 0.9.0-DAT-3420-remove-find-replace 0.8.2-staging 0.8.1-staging 0.8.0 0.8.0-staging 0.8.0-internal 0.7.1 0.7.1-internal 0.7.0 0.7.0-staging 0.7.0-internal 0.6.3-DAT-3371-homebrew 0.6.2-yishay 0.6.2-staging 0.6.1-staging 0.6.1-docker 0.6.0-staging 0.5.0 0.5.0-staging 0.5.0-internal 0.4.4-DAT-3363-docker-image 0.4.3-DAT-3363-docker-image 0.4.2-staging 0.4.2-DAT-3363-docker-image 0.4.1-staging 0.4.1-DAT-3363-docker-image 0.4.0 0.4.0-staging 0.4.0-internal 0.3.2 0.3.2-internal 0.3.1-staging 0.3.0-fix-semver 0.2.2 0.2.2-staging 0.2.2-internal 0.2.1 0.2.1-staging 0.2.1-internal 0.2.0 0.2.0-staging 0.2.0-internal 0.2.0-fix-semver 0.1.763 0.1.763-internal 0.1.741 0.1.741-internal 0.0.1-docker vv1.4.41-rc v1.8.2-rc v1.8.1 v1.8.1-rc v1.8.0 v1.8.0-rc v1.7.3 v1.7.3-rc v1.7.2-rc v1.7.1 v1.7.1-rc v1.7.0-rc v1.6.49-rc v1.6.48 v1.6.48-rc v1.6.47-rc v1.6.46 v1.6.46-rc v1.6.45-rc v1.6.44 v1.6.44-rc v1.6.43-rc v1.6.42 v1.6.42-rc v1.6.41-rc v1.6.40 v1.6.40-rc v1.6.39-rc v1.6.38-rc v1.6.37 v1.6.37-rc v1.6.36 v1.6.36-rc v1.6.35-rc v1.6.34-rc v1.6.33 v1.6.33-rc v1.6.32 v1.6.32-rc v1.6.31-rc v1.6.30-rc v1.6.29 v1.6.29-rc v1.6.28 v1.6.28-rc v1.6.27 v1.6.27-rc v1.6.26 v1.6.26-rc v1.6.25 v1.6.25-rc v1.6.24 v1.6.24-rc v1.6.23 v1.6.23-rc v1.6.22-rc v1.6.21-rc v1.6.20-rc v1.6.19 v1.6.19-rc v1.6.18 v1.6.18-rc v1.6.17-rc v1.6.16 v1.6.16-rc v1.6.15-rc v1.6.14 v1.6.14-rc v1.6.13 v1.6.13-rc v1.6.12 v1.6.12-rc v1.6.11-rc v1.6.10-rc v1.6.9-rc v1.6.8-rc v1.6.7-rc v1.6.6 v1.6.6-rc v1.6.5-rc v1.6.4-rc v1.6.3-rc v1.6.2-rc v1.6.1-rc v1.6.0 v1.6.0-rc v1.5.38-rc v1.5.37 v1.5.37-rc v1.5.36 v1.5.36-rc v1.5.35 v1.5.35-rc v1.5.34-rc v1.5.33-rc v1.5.32-rc v1.5.31-rc v1.5.30 v1.5.30-rc v1.5.29 v1.5.29-rc v1.5.28-rc v1.5.27-rc v1.5.26-rc v1.5.25 v1.5.25-rc v1.5.24-rc v1.5.23-rc v1.5.22-rc v1.5.21-rc v1.5.20 v1.5.20-rc v1.5.19 v1.5.19-rc v1.5.18-rc v1.5.17 v1.5.17-rc v1.5.16 v1.5.16-rc v1.5.15 v1.5.15-rc v1.5.14 v1.5.13 v1.5.12 v1.5.11 v1.5.10 v1.5.9 v1.5.7 v1.5.4-rc v1.5.3 v1.5.3-rc v1.5.2 v1.5.0 v1.4.43-rc v1.4.42-rc v1.4.41-rc v1.4.40-rc v1.4.40-rc-dima-test v0.0.189798_tzlil_debug v0.0.3 v0.0.2-extract_evaluation v0.0.1 v0.0.1-extract_evaluation v-extract_evaluation
No related merge requests found
Showing with 57 additions and 22 deletions
+57 -22
......@@ -34,10 +34,11 @@ type EvaluationResults struct {
}
}
func (e *Evaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion string) (*cliClient.CreateEvaluationResponse, error) {
func (e *Evaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion string, policyName string) (*cliClient.CreateEvaluationResponse, error) {
createEvaluationResponse, err := e.cliClient.CreateEvaluation(&cliClient.CreateEvaluationRequest{
K8sVersion: &k8sVersion,
CliId: cliId,
PolicyName: policyName,
Metadata: &cliClient.Metadata{
CliVersion: cliVersion,
Os: e.osInfo.OS,
......
......@@ -77,11 +77,12 @@ func TestCreateEvaluation(t *testing.T) {
cliId := "test_token"
cliVersion := "0.0.7"
k8sVersion := "1.18.1"
policyName := "Default"
mockedCliClient.On("CreateEvaluation", mock.Anything).Return(&cliClient.CreateEvaluationResponse{EvaluationId: 1, K8sVersion: k8sVersion}, nil)
expectedCreateEvaluationResponse := &cliClient.CreateEvaluationResponse{EvaluationId: 1, K8sVersion: k8sVersion}
createEvaluationResponse, _ := evaluator.CreateEvaluation(cliId, cliVersion, k8sVersion)
createEvaluationResponse, _ := evaluator.CreateEvaluation(cliId, cliVersion, k8sVersion, policyName)
mockedCliClient.AssertCalled(t, "CreateEvaluation", mock.Anything)
assert.Equal(t, expectedCreateEvaluationResponse, createEvaluationResponse)
......
......@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/datreeio/datree/bl/validation"
......@@ -25,14 +26,14 @@ type FormattedOutput struct {
InvalidK8sFiles []*validation.InvalidK8sFile
}
func PrintResults(results *EvaluationResults, invalidYamlFiles []*validation.InvalidYamlFile, invalidK8sFiles []*validation.InvalidK8sFile, evaluationSummary printer.EvaluationSummary, loginURL string, outputFormat string, printer Printer, k8sVersion string) error {
func PrintResults(results *EvaluationResults, invalidYamlFiles []*validation.InvalidYamlFile, invalidK8sFiles []*validation.InvalidK8sFile, evaluationSummary printer.EvaluationSummary, loginURL string, outputFormat string, printer Printer, k8sVersion string, policyName string) error {
switch {
case outputFormat == "json":
return jsonOutput(&FormattedOutput{EvaluationResults: results, EvaluationSummary: evaluationSummary, InvalidYamlFiles: invalidYamlFiles, InvalidK8sFiles: invalidK8sFiles})
case outputFormat == "yaml":
return yamlOutput(&FormattedOutput{EvaluationResults: results, EvaluationSummary: evaluationSummary, InvalidYamlFiles: invalidYamlFiles, InvalidK8sFiles: invalidK8sFiles})
default:
return textOutput(results, invalidYamlFiles, invalidK8sFiles, evaluationSummary, loginURL, printer, k8sVersion)
return textOutput(results, invalidYamlFiles, invalidK8sFiles, evaluationSummary, loginURL, printer, k8sVersion, policyName)
}
}
......@@ -58,7 +59,7 @@ func yamlOutput(formattedOutput *FormattedOutput) error {
return nil
}
func textOutput(results *EvaluationResults, invalidYamlFiles []*validation.InvalidYamlFile, invalidK8sFiles []*validation.InvalidK8sFile, evaluationSummary printer.EvaluationSummary, url string, printer Printer, k8sVersion string) error {
func textOutput(results *EvaluationResults, invalidYamlFiles []*validation.InvalidYamlFile, invalidK8sFiles []*validation.InvalidK8sFile, evaluationSummary printer.EvaluationSummary, url string, printer Printer, k8sVersion string, policyName string) error {
pwd, err := os.Getwd()
if err != nil {
return err
......@@ -72,7 +73,7 @@ func textOutput(results *EvaluationResults, invalidYamlFiles []*validation.Inval
printer.PrintWarnings(warnings)
summary := parseEvaluationResultsToSummary(results, evaluationSummary, url)
summary := parseEvaluationResultsToSummary(results, evaluationSummary, url, policyName)
printer.PrintEvaluationSummary(evaluationSummary, k8sVersion)
......@@ -135,8 +136,7 @@ func parseToPrinterWarnings(results *EvaluationResults, invalidYamlFiles []*vali
type OutputTitle int
const (
EnabledRules OutputTitle = iota
EvaluatedConfigurations
EvaluatedConfigurations OutputTitle = iota
TotalRulesEvaluated
SeeAll
TotalRulesPassed
......@@ -145,14 +145,20 @@ const (
func (t OutputTitle) String() string {
return [...]string{
"Enabled rules in policy “default”",
"Configs tested against policy",
"Total rules evaluated",
"See all rules in policy",
"Total rules passed",
"Total rules failed"}[t]
}
func parseEvaluationResultsToSummary(results *EvaluationResults, evaluationSummary printer.EvaluationSummary, loginURL string) printer.Summary {
func buildEnabledRulesTitle(policyName string) string {
var str strings.Builder
fmt.Fprintf(&str, "Enabled rules in policy “%s”", policyName)
return str.String()
}
func parseEvaluationResultsToSummary(results *EvaluationResults, evaluationSummary printer.EvaluationSummary, loginURL string, policyName string) printer.Summary {
configsCount := evaluationSummary.ConfigsCount
totalRulesEvaluated := 0
totalFailedRules := 0
......@@ -165,7 +171,7 @@ func parseEvaluationResultsToSummary(results *EvaluationResults, evaluationSumma
}
plainRows := []printer.SummaryItem{
{LeftCol: EnabledRules.String(), RightCol: fmt.Sprint(evaluationSummary.RulesCount), RowIndex: 0},
{LeftCol: buildEnabledRulesTitle(policyName), RightCol: fmt.Sprint(evaluationSummary.RulesCount), RowIndex: 0},
{LeftCol: EvaluatedConfigurations.String(), RightCol: fmt.Sprint(configsCount), RowIndex: 1},
{LeftCol: TotalRulesEvaluated.String(), RightCol: fmt.Sprint(totalRulesEvaluated), RowIndex: 2},
{LeftCol: SeeAll.String(), RightCol: loginURL, RowIndex: 5},
......
......@@ -55,7 +55,7 @@ func TestPrintResults(t *testing.T) {
mockedPrinter.On("PrintEvaluationSummary", mock.Anything, mock.Anything)
t.Run(tt.name, func(t *testing.T) {
_ = PrintResults(tt.args.results, tt.args.invalidYamlFiles, tt.args.invalidK8sFiles, tt.args.evaluationSummary, tt.args.loginURL, tt.args.outputFormat, mockedPrinter, "1.18.0")
_ = PrintResults(tt.args.results, tt.args.invalidYamlFiles, tt.args.invalidK8sFiles, tt.args.evaluationSummary, tt.args.loginURL, tt.args.outputFormat, mockedPrinter, "1.18.0", "Default")
if tt.args.outputFormat == "json" {
mockedPrinter.AssertNotCalled(t, "PrintWarnings")
......
......@@ -22,7 +22,7 @@ import (
type Evaluator interface {
Evaluate(filesConfigurationsChan []*extractor.FileConfigurations, evaluationId int) (*evaluation.EvaluationResults, error)
CreateEvaluation(cliId string, cliVersion string, k8sVersion string) (*cliClient.CreateEvaluationResponse, error)
CreateEvaluation(cliId string, cliVersion string, k8sVersion string, policyName string) (*cliClient.CreateEvaluationResponse, error)
UpdateFailedYamlValidation(invalidFiles []*validation.InvalidYamlFile, evaluationId int, stopEvaluation bool) error
UpdateFailedK8sValidation(invalidFiles []*validation.InvalidK8sFile, evaluationId int, stopEvaluation bool) error
}
......@@ -40,6 +40,7 @@ type TestCommandFlags struct {
Output string
K8sVersion string
IgnoreMissingSchemas bool
PolicyName string
}
type EvaluationPrinter interface {
......@@ -84,7 +85,7 @@ func New(ctx *TestCommandContext) *cobra.Command {
var err error = nil
defer func() {
if err != nil {
fmt.Println(err.Error())
ctx.Printer.PrintMessage(strings.Join([]string{"\n", err.Error(), "\n"}, ""), "error")
}
}()
......@@ -103,7 +104,12 @@ func New(ctx *TestCommandContext) *cobra.Command {
return err
}
testCommandFlags := TestCommandFlags{Output: outputFlag, K8sVersion: k8sVersion, IgnoreMissingSchemas: ignoreMissingSchemas}
policy, err := cmd.Flags().GetString("policy")
if err != nil {
return err
}
testCommandFlags := TestCommandFlags{Output: outputFlag, K8sVersion: k8sVersion, IgnoreMissingSchemas: ignoreMissingSchemas, PolicyName: policy}
err = test(ctx, args, testCommandFlags)
if err != nil {
......@@ -117,6 +123,7 @@ func New(ctx *TestCommandContext) *cobra.Command {
testCommand.Flags().StringP("output", "o", "", "Define output format")
testCommand.Flags().StringP("schema-version", "s", "", "Set kubernetes version to validate against. Defaults to 1.18.0")
testCommand.Flags().StringP("policy", "p", "", "Policy name to run against")
testCommand.Flags().BoolP("ignore-missing-schemas", "", false, "Ignore missing schemas when executing schema validation step")
return testCommand
}
......@@ -176,7 +183,7 @@ func test(ctx *TestCommandContext, paths []string, flags TestCommandFlags) error
validYamlFilesConfigurationsChan, invalidYamlFilesChan := files.ExtractFilesConfigurations(filesPaths, concurrency)
createEvaluationResponse, err := ctx.Evaluator.CreateEvaluation(localConfigContent.CliId, ctx.CliVersion, flags.K8sVersion)
createEvaluationResponse, err := ctx.Evaluator.CreateEvaluation(localConfigContent.CliId, ctx.CliVersion, flags.K8sVersion, flags.PolicyName)
if err != nil {
return err
}
......@@ -236,7 +243,7 @@ func test(ctx *TestCommandContext, paths []string, flags TestCommandFlags) error
PassedPolicyCheckCount: passedPolicyCheckCount,
}
err = evaluation.PrintResults(results, invalidYamlFiles, invalidK8sFiles, evaluationSummary, fmt.Sprintf("https://app.datree.io/login?cliId=%s", localConfigContent.CliId), flags.Output, ctx.Printer, createEvaluationResponse.K8sVersion)
err = evaluation.PrintResults(results, invalidYamlFiles, invalidK8sFiles, evaluationSummary, fmt.Sprintf("https://app.datree.io/login?cliId=%s", localConfigContent.CliId), flags.Output, ctx.Printer, createEvaluationResponse.K8sVersion, createEvaluationResponse.PolicyName)
var invocationFailedErr error = nil
......
package test
import (
"fmt"
"testing"
"github.com/datreeio/datree/bl/validation"
......@@ -23,8 +24,11 @@ func (m *mockEvaluator) Evaluate(filesConfigurationsChan []*extractor.FileConfig
return args.Get(0).(*evaluation.EvaluationResults), args.Error(1)
}
func (m *mockEvaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion string) (*cliClient.CreateEvaluationResponse, error) {
args := m.Called(cliId, cliVersion, k8sVersion)
func (m *mockEvaluator) CreateEvaluation(cliId string, cliVersion string, k8sVersion string, policyName string) (*cliClient.CreateEvaluationResponse, error) {
fmt.Println("*****************")
fmt.Println(cliId, cliVersion, k8sVersion, policyName)
fmt.Println("*****************")
args := m.Called(cliId, cliVersion, k8sVersion, policyName)
return args.Get(0).(*cliClient.CreateEvaluationResponse), args.Error(1)
}
......@@ -121,7 +125,7 @@ func TestTestCommand(t *testing.T) {
mockedEvaluator := &mockEvaluator{}
mockedEvaluator.On("Evaluate", mock.Anything, mock.Anything, mock.Anything).Return(evaluationResults, nil)
mockedEvaluator.On("CreateEvaluation", mock.Anything, mock.Anything, mock.Anything).Return(&cliClient.CreateEvaluationResponse{EvaluationId: evaluationId, K8sVersion: "1.18.0", RulesCount: 21}, nil)
mockedEvaluator.On("CreateEvaluation", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&cliClient.CreateEvaluationResponse{EvaluationId: evaluationId, K8sVersion: "1.18.0", RulesCount: 21}, nil)
mockedEvaluator.On("UpdateFailedYamlValidation", mock.Anything, mock.Anything, mock.Anything).Return(nil)
mockedEvaluator.On("UpdateFailedK8sValidation", mock.Anything, mock.Anything, mock.Anything).Return(nil)
messager := &mockMessager{}
......@@ -165,8 +169,9 @@ func TestTestCommand(t *testing.T) {
}
func test_testCommand_no_flags(t *testing.T, evaluator *mockEvaluator, filesConfigurations []*extractor.FileConfigurations, evaluationId int, ctx *TestCommandContext) {
test(ctx, []string{"8/*"}, TestCommandFlags{K8sVersion: "", Output: ""})
test(ctx, []string{"8/*"}, TestCommandFlags{K8sVersion: "1.18.0", Output: "", PolicyName: "Default"})
evaluator.AssertCalled(t, "CreateEvaluation", "134kh", "", "1.18.0", "Default")
evaluator.AssertCalled(t, "Evaluate", filesConfigurations, evaluationId)
}
......
......@@ -321,6 +321,7 @@ func test_createEvaluation_success() *CreateEvaluationTestCase {
createEvaluationRequest: &CreateEvaluationRequest{
K8sVersion: &k8sVersion,
CliId: "cli_id",
PolicyName: "Default",
Metadata: &Metadata{
CliVersion: "0.0.1",
Os: "darwin",
......@@ -366,6 +367,7 @@ func test_createEvaluation_success() *CreateEvaluationTestCase {
body: &CreateEvaluationRequest{
K8sVersion: &k8sVersion,
CliId: "cli_id",
PolicyName: "Default",
Metadata: &Metadata{
CliVersion: "0.0.1",
Os: "darwin",
......
......@@ -18,12 +18,14 @@ type CreateEvaluationRequest struct {
CliId string `json:"cliId"`
Metadata *Metadata `json:"metadata"`
K8sVersion *string `json:"k8sVersion"`
PolicyName string `json:"policyName"`
}
type CreateEvaluationResponse struct {
EvaluationId int `json:"evaluationId"`
K8sVersion string `json:"k8sVersion"`
RulesCount int `json:"rulesCount"`
PolicyName string `json:"policyName"`
}
func (c *CliClient) CreateEvaluation(request *CreateEvaluationRequest) (*CreateEvaluationResponse, error) {
......
......@@ -72,7 +72,13 @@ func (c *Client) Request(method string, resourceURI string, body interface{}, he
}
if response.StatusCode > 399 {
return responseBody, fmt.Errorf("Error: %v", string(b))
var errorJson map[string]interface{}
err = json.Unmarshal(b, &errorJson)
if err != nil {
return responseBody, err
}
return responseBody, fmt.Errorf(fmt.Sprintf("%v", errorJson["message"]))
}
responseBody = Response{
......
......@@ -164,6 +164,8 @@ func (p *Printer) printInColor(title string, color *color.Color) {
func (p *Printer) createNewColor(clr string) *color.Color {
switch clr {
case "error":
return p.theme.Colors.Error
case "red":
return p.theme.Colors.Red
case "yellow":
......
......@@ -13,6 +13,7 @@ type theme struct {
Yellow *color.Color
Red *color.Color
White *color.Color
Error *color.Color
}
Spacing struct {
Default string
......@@ -30,10 +31,12 @@ func createTheme() *theme {
Yellow *color.Color
Red *color.Color
White *color.Color
Error *color.Color
}{
Green: color.New(color.FgGreen),
Yellow: color.New(color.FgYellow),
Red: color.New(color.FgHiRed, color.Bold),
Error: color.New(color.FgHiRed),
White: color.New(color.FgHiWhite),
},
Spacing: struct{ Default string }{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment