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

Fix policy docs for different scopes for different policies #295

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shubbhang351
Copy link
Contributor

  1. What this PR does / why we need it:

Fix policy docs for different scopes for different policies

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (3b8edbd) 25.39% compared to head (b30dbab) 25.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
- Coverage   25.39%   25.31%   -0.09%     
==========================================
  Files         155      156       +1     
  Lines       13591    13636      +45     
==========================================
  Hits         3452     3452              
- Misses       9982    10027      +45     
  Partials      157      157              
Files Coverage Δ
...icy/kind/custom/resource/resource_custom_policy.go 0.00% <ø> (ø)
...d/image/resource/resource_image_registry_policy.go 0.00% <ø> (ø)
...y/kind/network/resource/resource_network_policy.go 0.00% <ø> (ø)
...olicy/kind/quota/resource/resource_quota_policy.go 0.00% <ø> (ø)
...kind/security/resource/resource_security_policy.go 0.00% <ø> (ø)
internal/resources/policy/scope/constants.go 0.00% <0.00%> (ø)
internal/resources/policy/scope/scope_schema.go 14.92% <0.00%> (-4.69%) ⬇️

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

Copy link
Contributor

@ramya-bangera ramya-bangera left a comment

Choose a reason for hiding this comment

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

Thank you @Shubbhang351 for making this change :-)

Copy link
Contributor

@ishangupta-ds ishangupta-ds left a comment

Choose a reason for hiding this comment

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

Run acceptance tests for all updated resources and attach output screenshots.

scope.WithDescription(fmt.Sprintf("Scope for the image policy, having one of the valid scopes: %v.", strings.Join(ScopesAllowed[:], `, `))),
scope.WithScopes(ScopesAllowed[:]))
)

var imagePolicySchema = map[string]*schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Merge the var blocks together

scope.WithDescription(fmt.Sprintf("Scope for the network policy, having one of the valid scopes: %v.", strings.Join(ScopesAllowed[:], `, `))),
scope.WithScopes(ScopesAllowed[:]))
)

var networkPolicySchema = map[string]*schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: combine the var together

var (
ScopesAllowed = [...]string{scope.ClusterKey, scope.ClusterGroupKey, scope.OrganizationKey}
ScopeSchema = scope.GetScopeSchema(
scope.WithDescription(fmt.Sprintf("Scope for the security policy, having one of the valid scopes: %v.", strings.Join(ScopesAllowed[:], `, `))),
Copy link
Contributor

Choose a reason for hiding this comment

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

%s instead of %v?

@tenthirtyam tenthirtyam added the needs-review Needs Review label Nov 7, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Nov 7, 2024
@tenthirtyam tenthirtyam force-pushed the main branch 2 times, most recently from 0c63249 to b38b497 Compare November 13, 2024 16:56
@tenthirtyam tenthirtyam added the merge-conflicts Merge Conflicts label Nov 13, 2024
@tenthirtyam tenthirtyam marked this pull request as draft November 13, 2024 17:08
@github-actions github-actions bot added documentation Documentation provider Provider labels Nov 15, 2024
@tenthirtyam
Copy link
Contributor

Rebased and merge conflicts resolved.

Copy link
Contributor

@tenthirtyam tenthirtyam left a comment

Choose a reason for hiding this comment

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

Error: internal/resources/policy/kind/mutation/resource/resource_mutation_policy.go:41:24: undefined: scope.ScopeSchema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation needs-review Needs Review provider Provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants