-
Notifications
You must be signed in to change notification settings - Fork 362
Conversation
PrintSummaryTable(summary printer.Summary) | ||
} | ||
|
||
// url := "https://app.datree.io/login?cliId=" + cliId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
|
||
// url := "https://app.datree.io/login?cliId=" + cliId | ||
func PrintResults(results *EvaluationResults, loginURL string, outputFormat string, printer Printer) error { | ||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this!!
bl/validator/validator.go
Outdated
"sync" | ||
|
||
"github.com/datreeio/datree/bl/files" | ||
kubeconformValidator "github.com/yannh/kubeconform/pkg/validator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to specify specific commit here? to try and keep it more stable
} | ||
|
||
func version(ctx *VersionCommandContext) { | ||
messageChannel := bl.PopulateVersionMessageChan(ctx.VersionMessageClient, ctx.CliVersion) | ||
messages := make(chan *messager.VersionMessage, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can only have one message. I think this assumes that each version supports multiple messages which we don't at the moment.
Not a big issue, just pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as much as I know this is the best way to handle 1 buffered channels (the last argument 1
indicates that this channel is allocated to only one member)
pkg/cliClient/evaluation.go
Outdated
} | ||
|
||
func (c *CliClient) CreateEvaluation(request *CreateEvaluationRequest) (int, error) { | ||
httpRes, err := c.httpClient.Request(http.MethodPost, "/cli/evaluate/create", request, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request url is cli/evaluation/create
Yishay's fix
pkg/cliClient/evaluation.go
Outdated
type UpdateEvaluationValidationRequest struct { | ||
EvaluationId int `json:"evaluationId"` | ||
InvalidFiles []*string `json:"failedFiles"` | ||
StopEvaluation bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing json expected value stopEvaluation
cmd/test/main.go
Outdated
|
||
config, err := ctx.LocalConfig.GetConfiguration() | ||
validPaths, invalidPaths, _ := ctx.Validator.Validate(paths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubeconform step is performed before the createEvaluation
request. although it doesn't make much difference right now because they are unrelated steps, I feel like conseptually we should run the validation step after we create an evaluation.
In case there's a panic inside validate or whatever, this might break the flow without any record of it being run.
also, we will later add another step (yamlValidation) and I think we should keep the step 0 -> 1 -> 2 -> 3 structure
cmd/test/main.go
Outdated
if err != nil { | ||
fmt.Println(err.Error()) | ||
return err | ||
} | ||
|
||
evaluationResponse, fileParsingErrors, err := ctx.Evaluator.Evaluate(paths, config.CliId, 50, ctx.CliVersion) | ||
results, errors, err := ctx.Evaluator.Evaluate(validPaths, invalidPaths, evaluationId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you chose here to forward the invalidPaths
array into the evaluate function and let the evaluator deal with it.
note that if we're giving the evaluator the 'power' to handle invalid files, we will need to later enhance it once we add the second validation - yaml validation (step 1).
not a deal breaker, just pointing that out.
Dat 3230 validation tests
a580feb
to
1e5bc63
Compare
…to DAT-3230-validate-k8s
…to DAT-3230-validate-k8s
…to DAT-3230-validate-k8s
No description provided.