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

removing generate error message #1364

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

NoSkillGirl
Copy link
Contributor

@NoSkillGirl NoSkillGirl commented Dec 7, 2020

Related issue

closes #1320

What type of PR is this?

/kind bug

Proposed changes

skipping update of status for generate request

Checklist

@NoSkillGirl NoSkillGirl requested review from realshuting and JimBugwadia and removed request for realshuting December 7, 2020 19:24
@realshuting realshuting merged commit d07058e into kyverno:main Dec 7, 2020
Copy link
Member

@JimBugwadia JimBugwadia left a comment

Choose a reason for hiding this comment

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

minor comments....please take a look.

@@ -47,6 +48,12 @@ func (c *Controller) processGR(gr *kyverno.GenerateRequest) error {
events := failedEvents(err, *gr, *resource)
c.eventGen.Add(events...)

// Need not update the stauts when policy doesn't apply on resource, because all the generate requests are removed by the cleanup controller
Copy link
Member

Choose a reason for hiding this comment

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

typo for status

@@ -47,6 +48,12 @@ func (c *Controller) processGR(gr *kyverno.GenerateRequest) error {
events := failedEvents(err, *gr, *resource)
c.eventGen.Add(events...)

// Need not update the stauts when policy doesn't apply on resource, because all the generate requests are removed by the cleanup controller
if err != nil && strings.Contains(err.Error(), "does not apply to resource") {
Copy link
Member

Choose a reason for hiding this comment

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

would be best not to use error strings for comparison, as these can be changed. Instead we can introduce an error type and check for that. See: https://blog.golang.org/go1.13-errors.

@NoSkillGirl NoSkillGirl added this to the Kyverno Release 1.3.0 milestone Dec 22, 2020
@realshuting realshuting removed this from the Kyverno Release 1.3.0 milestone Jan 4, 2021
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.

[BUG] Generate shows error message "Operation cannot be fulfilled"
3 participants