Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support online validation with Konnect #1335

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

GGabriele
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 38 lines in your changes missing coverage. Please review.

Project coverage is 28.99%. Comparing base (5f84270) to head (cf17473).

Files with missing lines Patch % Lines
cmd/gateway_validate.go 0.00% 24 Missing ⚠️
tests/integration/test_utils.go 0.00% 12 Missing ⚠️
validate/validate.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1335      +/-   ##
==========================================
- Coverage   29.14%   28.99%   -0.16%     
==========================================
  Files          59       59              
  Lines        5215     5243      +28     
==========================================
  Hits         1520     1520              
- Misses       3587     3615      +28     
  Partials      108      108              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -181,6 +181,9 @@ func (v *Validator) Validate(formatVersion semver.Version) []error {
if err := v.entities(v.state.FilterChains, "filter_chains"); err != nil {
allErr = append(allErr, err...)
}
if err := v.entities(v.state.Vaults, "vaults"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I lack some context here. How is this addition related to this PR? @GGabriele

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping: @GGabriele. Do you mind chiming in here? 🙇

Also, this change adds a conditional that ensures that rbac flag used
with konnect mode, gives an legible error to the user.
@Prashansa-K
Copy link
Contributor

Other e2e tests for deck validate commands are added here: #1415

Kept this PR scoped to Konnect stuff.

@Prashansa-K Prashansa-K marked this pull request as ready for review October 10, 2024 06:00
@Prashansa-K
Copy link
Contributor

@pmalek Could you please help us with a review here? We have extended deck gateway validate command to work with Konnect as well. Changelog will be added during release time, as is the practice we follow here with deck releases currently.

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some minor comments but to me this looks pretty solid 👍

Comment on lines +393 to +395
cmdErr := deckCmd.ExecuteContext(context.Background())

return cmdErr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmdErr := deckCmd.ExecuteContext(context.Background())
return cmdErr
return deckCmd.ExecuteContext(context.Background())

Comment on lines +73 to +76
validateOpts := []string{
tc.stateFile,
}
validateOpts = append(validateOpts, tc.additionalArgs...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
validateOpts := []string{
tc.stateFile,
}
validateOpts = append(validateOpts, tc.additionalArgs...)
validateOpts = append([]string{tc.stateFile}, tc.additionalArgs...)

Comment on lines +84 to +87
}
} else {
assert.NoError(t, err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
} else {
assert.NoError(t, err)
}
}
return
}
assert.NoError(t, err)

@@ -374,3 +374,23 @@ func render(opts ...string) (string, error) {

return stripansi.Strip(string(out)), cmdErr
}

func validate(online bool, opts ...string) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: might as well make the first parameter its own type so that we can call it like:

validate(Online, args...)

Instead of passing bool explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants