mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
Improve error message when name is omitted but generateName is available
This commit is contained in:
@@ -21,14 +21,16 @@ import (
|
||||
)
|
||||
|
||||
type attributesRecord struct {
|
||||
kind string
|
||||
namespace string
|
||||
resource string
|
||||
operation string
|
||||
object runtime.Object
|
||||
}
|
||||
|
||||
func NewAttributesRecord(object runtime.Object, namespace, resource, operation string) Attributes {
|
||||
func NewAttributesRecord(object runtime.Object, kind, namespace, resource, operation string) Attributes {
|
||||
return &attributesRecord{
|
||||
kind: kind,
|
||||
namespace: namespace,
|
||||
resource: resource,
|
||||
operation: operation,
|
||||
@@ -36,6 +38,10 @@ func NewAttributesRecord(object runtime.Object, namespace, resource, operation s
|
||||
}
|
||||
}
|
||||
|
||||
func (record *attributesRecord) GetKind() string {
|
||||
return record.kind
|
||||
}
|
||||
|
||||
func (record *attributesRecord) GetNamespace() string {
|
||||
return record.namespace
|
||||
}
|
||||
|
Reference in New Issue
Block a user