Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Eikykun committed Aug 16, 2023
1 parent 7bf7e79 commit 3042d53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion pkg/controllers/ruleset/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func (c *checker) GetState(client client.Client, item client.Object) (CheckState
}

rulesetNames := utils.GetRuleSets(item)
fmt.Printf("%d\n", len(rulesetNames))
// TODO: list ruleset, check match ruleset
// TODO: add ruleset anno by webhook

Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/ruleset/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package processor

import (
"math"
"os"
"reflect"
"sort"
Expand Down Expand Up @@ -91,7 +92,7 @@ func (p *Processor) Process(targets map[string]*corev1.Pod) *ProcessResult {
rejected := map[string]RejectInfo{}
var ruleStates []*appsv1alpha1.RuleState

minInterval := time.Duration(MaxInt32) * time.Second
minInterval := time.Duration(math.MaxInt32) * time.Second
retry := false

for po := range processingPods {
Expand Down Expand Up @@ -172,7 +173,7 @@ func (p *Processor) Process(targets map[string]*corev1.Pod) *ProcessResult {
RuleStates: ruleStates,
}

if minInterval != time.Duration(MaxInt32) {
if minInterval != time.Duration(math.MaxInt32) {
res.Interval = &minInterval
}
return res
Expand All @@ -194,7 +195,6 @@ type RejectInfo struct {
}

const (
MaxInt32 = int64(0x3f3f3f3f)
EnvSkipRuleSetRules = "SKIP_RULESET_RULES"
)

Expand Down

0 comments on commit 3042d53

Please sign in to comment.