Enable more linters, and remove mal-functioned milestoned issue action.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-25 23:31:51 +08:00
parent a0b0b7cd9b
commit 443f732e51
19 changed files with 49 additions and 65 deletions
+2 -2
View File
@@ -18,12 +18,12 @@ package boolptr
// IsSetToTrue returns true if and only if the bool pointer is non-nil and set to true.
func IsSetToTrue(b *bool) bool {
return b != nil && *b == true
return b != nil && *b
}
// IsSetToFalse returns true if and only if the bool pointer is non-nil and set to false.
func IsSetToFalse(b *bool) bool {
return b != nil && *b == false
return b != nil && !*b
}
// True returns a *bool whose underlying value is true.
+2 -2
View File
@@ -138,7 +138,7 @@ func (ie *GlobalIncludesExcludes) ShouldInclude(typeName string) bool {
return false
}
if resource.Namespaced == false && boolptr.IsSetToFalse(ie.includeClusterResources) {
if !resource.Namespaced && boolptr.IsSetToFalse(ie.includeClusterResources) {
ie.logger.Info("Skipping resource %s, because it's cluster-scoped, and IncludeClusterResources is set to false.", typeName)
return false
}
@@ -150,7 +150,7 @@ func (ie *GlobalIncludesExcludes) ShouldInclude(typeName string) bool {
// may still be backed up if triggered by a custom action (e.g. PVC->PV).
// If we're processing namespaces themselves, we will not skip here, they may be
// filtered out later.
if typeName != kuberesource.Namespaces.String() && resource.Namespaced == false &&
if typeName != kuberesource.Namespaces.String() && !resource.Namespaced &&
ie.includeClusterResources == nil && !ie.namespaceFilter.IncludeEverything() {
ie.logger.Infof("Skipping resource %s, because it's cluster-scoped and only specific namespaces or namespace scope types are included in the backup.", typeName)
return false