mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 02:45:06 +00:00
Fix typo, add short names (#1344)
* fix typo * add short names for report change request
This commit is contained in:
parent
c22d97a871
commit
370828afec
9 changed files with 2891 additions and 898 deletions
File diff suppressed because it is too large
Load diff
|
@ -13,8 +13,10 @@ spec:
|
|||
kind: ClusterReportChangeRequest
|
||||
listKind: ClusterReportChangeRequestList
|
||||
plural: clusterreportchangerequests
|
||||
shortNames:
|
||||
- crcr
|
||||
singular: clusterreportchangerequest
|
||||
scope: Cluster
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- additionalPrinterColumns:
|
||||
- jsonPath: .scope.kind
|
||||
|
|
|
@ -13,6 +13,8 @@ spec:
|
|||
kind: ReportChangeRequest
|
||||
listKind: ReportChangeRequestList
|
||||
plural: reportchangerequests
|
||||
shortNames:
|
||||
- rcr
|
||||
singular: reportchangerequest
|
||||
scope: Namespaced
|
||||
versions:
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,7 @@ import (
|
|||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests API
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +genclient:nonNamespaced
|
||||
|
@ -38,8 +39,7 @@ import (
|
|||
// +kubebuilder:printcolumn:name="Error",type=integer,JSONPath=`.summary.error`
|
||||
// +kubebuilder:printcolumn:name="Skip",type=integer,JSONPath=`.summary.skip`
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
|
||||
// ClusterReportChangeRequest is the Schema for the ClusterReportChangeRequests API
|
||||
// +kubebuilder:resource:shortName=crcr
|
||||
type ClusterReportChangeRequest struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
|
|
@ -25,6 +25,7 @@ import (
|
|||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
|
||||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
|
||||
|
||||
// ReportChangeRequest is the Schema for the ReportChangeRequests API
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
|
@ -36,8 +37,7 @@ import (
|
|||
// +kubebuilder:printcolumn:name="Error",type=integer,JSONPath=`.summary.error`
|
||||
// +kubebuilder:printcolumn:name="Skip",type=integer,JSONPath=`.summary.skip`
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
|
||||
|
||||
// ReportChangeRequest is the Schema for the ReportChangeRequests API
|
||||
// +kubebuilder:resource:shortName=rcr
|
||||
type ReportChangeRequest struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
|
|
@ -28,7 +28,7 @@ const (
|
|||
|
||||
//Controller manages life-cycle of generate-requests
|
||||
type Controller struct {
|
||||
// dyanmic client implementation
|
||||
// dynamic client implementation
|
||||
client *dclient.Client
|
||||
// typed client for kyverno CRDs
|
||||
kyvernoClient *kyvernoclient.Clientset
|
||||
|
@ -49,7 +49,7 @@ type Controller struct {
|
|||
pSynced cache.InformerSynced
|
||||
// grSynced returns true if the generate request store has been synced at least once
|
||||
grSynced cache.InformerSynced
|
||||
// dyanmic sharedinformer factory
|
||||
// dynamic sharedinformer factory
|
||||
dynamicInformer dynamicinformer.DynamicSharedInformerFactory
|
||||
//TODO: list of generic informers
|
||||
// only support Namespaces for deletion of resource
|
||||
|
|
|
@ -51,9 +51,9 @@ func NewResourceCache(log logr.Logger, config *rest.Config, dclient *dclient.Cli
|
|||
updateGVRCacheForConfigMap(resCache)
|
||||
}
|
||||
} else {
|
||||
err := udateGVRCache(logger, resCache, discoveryIface)
|
||||
err := updateGVRCache(logger, resCache, discoveryIface)
|
||||
if err != nil {
|
||||
logger.Error(err, "error in udateGVRCache function")
|
||||
logger.Error(err, "error in updateGVRCache function")
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ func updateGVRCacheForConfigMap(resc *ResourceCache) {
|
|||
resc.GVRCacheData["configmaps"] = gvrc
|
||||
}
|
||||
|
||||
func udateGVRCache(log logr.Logger, resc *ResourceCache, discoveryIface discovery.CachedDiscoveryInterface) error {
|
||||
func updateGVRCache(log logr.Logger, resc *ResourceCache, discoveryIface discovery.CachedDiscoveryInterface) error {
|
||||
serverResources, err := discoveryIface.ServerPreferredResources()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Reference in a new issue