forked from kyverno/kyverno
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix_mutate_existing_force_reconciliation
- Loading branch information
Showing
6 changed files
with
65 additions
and
5 deletions.
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
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,52 @@ | ||
package deprecations | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
|
||
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/apis/v1alpha1" | ||
) | ||
|
||
func CheckUserInfo(out io.Writer, path string, resource *v1alpha1.UserInfo) bool { | ||
if resource != nil { | ||
if resource.APIVersion == "" || resource.Kind == "" { | ||
if out != nil { | ||
fmt.Fprintf(out, "\nWARNING: user infos file (%s) uses a deprecated schema that will be removed in 1.13\n", path) | ||
} | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
func CheckValues(out io.Writer, path string, resource *v1alpha1.Values) bool { | ||
if resource != nil { | ||
if resource.APIVersion == "" || resource.Kind == "" { | ||
if out != nil { | ||
fmt.Fprintf(out, "\nWARNING: values file (%s) uses a deprecated schema that will be removed in 1.13\n", path) | ||
} | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
func CheckTest(out io.Writer, path string, resource *v1alpha1.Test) bool { | ||
if resource != nil { | ||
if resource.APIVersion == "" || resource.Kind == "" || resource.Name != "" { | ||
if out != nil { | ||
fmt.Fprintf(out, "\nWARNING: test file (%s) uses a deprecated schema that will be removed in 1.13\n", path) | ||
} | ||
return true | ||
} | ||
for _, result := range resource.Results { | ||
if result.TestResultDeprecated.Status != "" || result.TestResultDeprecated.Namespace != "" || result.TestResultDeprecated.Resource != "" { | ||
if out != nil { | ||
fmt.Fprintf(out, "\nWARNING: test file (%s) uses a deprecated schema that will be removed in 1.13\n", path) | ||
} | ||
return true | ||
} | ||
} | ||
} | ||
return false | ||
} |
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