Use long names for k8s object constants
parent
ae35752083
commit
3384e0b25d
|
@ -84,7 +84,7 @@ func checkPodTemplates(items *corev1.PodTemplateList, alert *alert) {
|
|||
func checkPVCs(items *corev1.PersistentVolumeClaimList, alert *alert) {
|
||||
for _, item := range items.Items {
|
||||
if corev1.NamespaceDefault == item.GetNamespace() {
|
||||
alert.warn(checks.PVC, item.ObjectMeta)
|
||||
alert.warn(checks.PersistentVolumeClaim, item.ObjectMeta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ func checkSecrets(items *corev1.SecretList, alert *alert) {
|
|||
func checkSA(items *corev1.ServiceAccountList, alert *alert) {
|
||||
for _, item := range items.Items {
|
||||
if corev1.NamespaceDefault == item.GetNamespace() && item.GetName() != "default" {
|
||||
alert.warn(checks.SA, item.ObjectMeta)
|
||||
alert.warn(checks.ServiceAccount, item.ObjectMeta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ func errors() []checks.Diagnostic {
|
|||
{
|
||||
Severity: checks.Warning,
|
||||
Message: "Avoid using the default namespace",
|
||||
Kind: checks.PVC,
|
||||
Kind: checks.PersistentVolumeClaim,
|
||||
Object: &pvc.ObjectMeta,
|
||||
Owners: pvc.ObjectMeta.GetOwnerReferences(),
|
||||
},
|
||||
|
@ -128,7 +128,7 @@ func errors() []checks.Diagnostic {
|
|||
{
|
||||
Severity: checks.Warning,
|
||||
Message: "Avoid using the default namespace",
|
||||
Kind: checks.SA,
|
||||
Kind: checks.ServiceAccount,
|
||||
Object: &sa.ObjectMeta,
|
||||
Owners: sa.ObjectMeta.GetOwnerReferences(),
|
||||
},
|
||||
|
|
|
@ -39,7 +39,7 @@ func (pv *unusedPVCheck) Run(objects *kube.Objects) ([]checks.Diagnostic, error)
|
|||
d := checks.Diagnostic{
|
||||
Severity: checks.Warning,
|
||||
Message: fmt.Sprintf("Unused Persistent Volume '%s'.", pv.GetName()),
|
||||
Kind: checks.PV,
|
||||
Kind: checks.PersistentVolume,
|
||||
Object: &pv.ObjectMeta,
|
||||
Owners: pv.ObjectMeta.GetOwnerReferences(),
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ func TestUnusedPVWarning(t *testing.T) {
|
|||
{
|
||||
Severity: checks.Warning,
|
||||
Message: "Unused Persistent Volume 'pv_foo'.",
|
||||
Kind: checks.PV,
|
||||
Kind: checks.PersistentVolume,
|
||||
Object: &metav1.ObjectMeta{Name: "pv_foo"},
|
||||
Owners: GetOwners(),
|
||||
},
|
||||
|
|
|
@ -29,10 +29,10 @@ const (
|
|||
Suggestion Severity = "suggestion"
|
||||
Pod Kind = "pod"
|
||||
PodTemplate Kind = "pod template"
|
||||
PVC Kind = "persistent volume claim"
|
||||
PersistentVolumeClaim Kind = "persistent volume claim"
|
||||
ConfigMap Kind = "config map"
|
||||
Service Kind = "service"
|
||||
Secret Kind = "secret"
|
||||
SA Kind = "service account"
|
||||
PV Kind = "persistent volume"
|
||||
ServiceAccount Kind = "service account"
|
||||
PersistentVolume Kind = "persistent volume"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue