-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ clusterctl: Suppress "finalizer name" API warnings in "move" command (
#11173) * ✨ util: Warning handler that discards a default set of messages * ✨ clusterctl: Suppress API warnings in "move" command * fixup! ✨ util: Warning handler that discards a default set of messages Move all handlers to one file, expressions to another * fixup! ✨ clusterctl: Suppress API warnings in "move" command Allow user to choose which warnings to hide * fixup! fixup! ✨ util: Warning handler that discards a default set of messages Make return value easier to consume * fixup! fixup! ✨ clusterctl: Suppress API warnings in "move" command Add LogAllHandler for consistent prefix, and DiscardAllHandler for convenience
- Loading branch information
1 parent
36d1add
commit 274d7e2
Showing
4 changed files
with
191 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright 2024 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package apiwarnings | ||
|
||
import ( | ||
"fmt" | ||
"regexp" | ||
) | ||
|
||
// DomainQualifiedFinalizerWarning is a regular expression that matches a | ||
// warning that the API server returns when a finalizer is not domain-qualified. | ||
func DomainQualifiedFinalizerWarning(domain string) regexp.Regexp { | ||
return *regexp.MustCompile( | ||
fmt.Sprintf("^metadata.finalizers:.*%s.*prefer a domain-qualified finalizer name to avoid accidental conflicts with other finalizer writers$", domain), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters