mirror of https://github.com/k3s-io/k3s
remove unnecessary TODOs in meta.go
parent
34001d8c6a
commit
4fea1687f6
|
@ -38,7 +38,6 @@ var errNotCommon = fmt.Errorf("object does not implement the common interface fo
|
||||||
|
|
||||||
// CommonAccessor returns a Common interface for the provided object or an error if the object does
|
// CommonAccessor returns a Common interface for the provided object or an error if the object does
|
||||||
// not provide List.
|
// not provide List.
|
||||||
// TODO: return bool instead of error
|
|
||||||
func CommonAccessor(obj interface{}) (metav1.Common, error) {
|
func CommonAccessor(obj interface{}) (metav1.Common, error) {
|
||||||
switch t := obj.(type) {
|
switch t := obj.(type) {
|
||||||
case List:
|
case List:
|
||||||
|
@ -71,7 +70,6 @@ func CommonAccessor(obj interface{}) (metav1.Common, error) {
|
||||||
// not provide List.
|
// not provide List.
|
||||||
// IMPORTANT: Objects are NOT a superset of lists. Do not use this check to determine whether an
|
// IMPORTANT: Objects are NOT a superset of lists. Do not use this check to determine whether an
|
||||||
// object *is* a List.
|
// object *is* a List.
|
||||||
// TODO: return bool instead of error
|
|
||||||
func ListAccessor(obj interface{}) (List, error) {
|
func ListAccessor(obj interface{}) (List, error) {
|
||||||
switch t := obj.(type) {
|
switch t := obj.(type) {
|
||||||
case List:
|
case List:
|
||||||
|
@ -101,7 +99,6 @@ var errNotObject = fmt.Errorf("object does not implement the Object interfaces")
|
||||||
// obj must be a pointer to an API type. An error is returned if the minimum
|
// obj must be a pointer to an API type. An error is returned if the minimum
|
||||||
// required fields are missing. Fields that are not required return the default
|
// required fields are missing. Fields that are not required return the default
|
||||||
// value and are a no-op if set.
|
// value and are a no-op if set.
|
||||||
// TODO: return bool instead of error
|
|
||||||
func Accessor(obj interface{}) (metav1.Object, error) {
|
func Accessor(obj interface{}) (metav1.Object, error) {
|
||||||
switch t := obj.(type) {
|
switch t := obj.(type) {
|
||||||
case metav1.Object:
|
case metav1.Object:
|
||||||
|
|
Loading…
Reference in New Issue