sukeesh / k8s-job-notify

Omit comparison with boolean constant SCC-S1002
Anti-pattern
Minor
3 years ago4 years old
should omit comparison to bool constant, can be simplified to !pastJobs[jobUniqueHash]
52			// job.Name can be same for different jobs, so using job.Name+CreationTimeStamp for checking
53			// uniqueness of the job. so that duplicated messages to slack can be avoided
54			jobUniqueHash := job.Name + job.CreationTimestamp.String()
55			if pastJobs[jobUniqueHash] == false {56				if level == "all" {
57					// Send success notifications.
58					if job.Status.Succeeded > 0 &&  (job.Status.CompletionTime.Add(20*time.Minute).Unix() > time.Now().Unix()) {