mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 15:04:17 +00:00
Enable more linters, and remove mal-functioned milestoned issue action.
Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user