Commit 33b20f22 authored by Dr. Stefan Schimanski's avatar Dr. Stefan Schimanski

pkg/apis/core: fixup package names

parent 3848e0a4
......@@ -10,22 +10,15 @@ cmd/kubelet/app
cmd/kubelet/app/options
cmd/kubemark
examples/guestbook-go
pkg/api
pkg/api/endpoints
pkg/api/helper
pkg/api/helper/qos
pkg/api/ref
pkg/api/testapi
pkg/api/testing
pkg/api/testing/compat
pkg/api/unversioned
pkg/api/v1/endpoints
pkg/api/v1/helper
pkg/api/v1/helper/qos
pkg/api/v1/pod
pkg/api/v1/resource
pkg/api/v1/validation
pkg/api/validation
pkg/apis/abac
pkg/apis/abac/latest
pkg/apis/admission
......@@ -51,6 +44,13 @@ pkg/apis/certificates/v1beta1
pkg/apis/certificates/validation
pkg/apis/componentconfig
pkg/apis/componentconfig/v1alpha1
pkg/apis/core
pkg/apis/core/helper
pkg/apis/core/helper/qos
pkg/apis/core/v1/helper
pkg/apis/core/v1/helper/qos
pkg/apis/core/v1/validation
pkg/apis/core/validation
pkg/apis/extensions
pkg/apis/extensions/validation
pkg/apis/imagepolicy
......
......@@ -43,8 +43,7 @@ find_files() {
-o -wholename '*/vendor/*' \
\) -prune \
\) \
\( -wholename '*pkg/api/v*/types.go' \
-o -wholename '*pkg/apis/*/v*/types.go' \
\( -wholename '*pkg/apis/*/v*/types.go' \
-o -wholename '*pkg/api/unversioned/types.go' \
\)
}
......@@ -71,7 +70,7 @@ for file in $versioned_api_files; do
fi
done
internal_types_files="${KUBE_ROOT}/pkg/api/types.go ${KUBE_ROOT}/pkg/apis/extensions/types.go"
internal_types_files="${KUBE_ROOT}/pkg/apis/core/types.go ${KUBE_ROOT}/pkg/apis/extensions/types.go"
for internal_types_file in $internal_types_files; do
if [[ ! -e $internal_types_file ]]; then
echo "Internal types file ${internal_types_file} does not exist"
......
......@@ -16,7 +16,7 @@ limitations under the License.
// This file should be consistent with pkg/api/v1/annotation_key_constants.go.
package api
package core
const (
// ImagePolicyFailedOpenKey is added to pods created by failing open when the image policy
......
......@@ -21,4 +21,4 @@ limitations under the License.
// The contract presented to clients is located in the versioned packages,
// which are sub-directories. The first one is "v1". Those packages
// describe how a particular version is serialized to storage/network.
package api // import "k8s.io/kubernetes/pkg/api"
package core // import "k8s.io/kubernetes/pkg/apis/core"
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
// Field path constants that are specific to the internal API
// representation.
......
......@@ -21,12 +21,12 @@ package qos
import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/helper"
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/helper"
)
func isSupportedQoSComputeResource(name api.ResourceName) bool {
supportedQoSComputeResources := sets.NewString(string(api.ResourceCPU), string(api.ResourceMemory))
func isSupportedQoSComputeResource(name core.ResourceName) bool {
supportedQoSComputeResources := sets.NewString(string(core.ResourceCPU), string(core.ResourceMemory))
return supportedQoSComputeResources.Has(string(name)) || helper.IsHugePageResourceName(name)
}
......@@ -34,9 +34,9 @@ func isSupportedQoSComputeResource(name api.ResourceName) bool {
// A pod is besteffort if none of its containers have specified any requests or limits.
// A pod is guaranteed only when requests and limits are specified for all the containers and they are equal.
// A pod is burstable if limits and requests do not match across all containers.
func GetPodQOS(pod *api.Pod) api.PodQOSClass {
requests := api.ResourceList{}
limits := api.ResourceList{}
func GetPodQOS(pod *core.Pod) core.PodQOSClass {
requests := core.ResourceList{}
limits := core.ResourceList{}
zeroQuantity := resource.MustParse("0")
isGuaranteed := true
for _, container := range pod.Spec.Containers {
......@@ -73,12 +73,12 @@ func GetPodQOS(pod *api.Pod) api.PodQOSClass {
}
}
if !qosLimitsFound.HasAll(string(api.ResourceMemory), string(api.ResourceCPU)) {
if !qosLimitsFound.HasAll(string(core.ResourceMemory), string(core.ResourceCPU)) {
isGuaranteed = false
}
}
if len(requests) == 0 && len(limits) == 0 {
return api.PodQOSBestEffort
return core.PodQOSBestEffort
}
// Check is requests match limits for all resources.
if isGuaranteed {
......@@ -91,7 +91,7 @@ func GetPodQOS(pod *api.Pod) api.PodQOSClass {
}
if isGuaranteed &&
len(requests) == len(limits) {
return api.PodQOSGuaranteed
return core.PodQOSGuaranteed
}
return api.PodQOSBurstable
return core.PodQOSBurstable
}
......@@ -23,9 +23,9 @@ import (
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/v1"
)
func init() {
......@@ -36,9 +36,9 @@ func init() {
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: api.GroupName,
GroupName: core.GroupName,
VersionPreferenceOrder: []string{v1.SchemeGroupVersion.Version},
AddInternalObjectsToScheme: api.AddToScheme,
AddInternalObjectsToScheme: core.AddToScheme,
RootScopedKinds: sets.NewString(
"Node",
"Namespace",
......
......@@ -25,8 +25,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
internal "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
internal "k8s.io/kubernetes/pkg/apis/core"
)
func TestResourceVersioner(t *testing.T) {
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
import "encoding/json"
......
......@@ -17,7 +17,7 @@ limitations under the License.
//TODO: consider making these methods functions, because we don't want helper
//functions in the k8s.io/api repo.
package api
package core
import (
"k8s.io/apimachinery/pkg/runtime/schema"
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
import (
"k8s.io/apimachinery/pkg/api/resource"
......
......@@ -17,7 +17,7 @@ limitations under the License.
//TODO: consider making these methods functions, because we don't want helper
//functions in the k8s.io/api repo.
package api
package core
import "fmt"
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
import "testing"
......
......@@ -17,7 +17,7 @@ limitations under the License.
//TODO: consider making these methods functions, because we don't want helper
//functions in the k8s.io/api repo.
package api
package core
// MatchToleration checks if the toleration matches tolerationToMatch. Tolerations are unique by <key,effect,operator,value>,
// if the two tolerations have same <key,effect,operator,value> combination, regard as they match.
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package api
package core
import (
"k8s.io/apimachinery/pkg/api/resource"
......
......@@ -32,10 +32,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/diff"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
kapitesting "k8s.io/kubernetes/pkg/api/testing"
k8s_api_v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/core"
corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
......@@ -59,7 +59,7 @@ func TestPodLogOptions(t *testing.T) {
TailLines: &tailLines,
LimitBytes: &limitBytes,
}
unversionedLogOptions := &api.PodLogOptions{
unversionedLogOptions := &core.PodLogOptions{
Container: "mycontainer",
Follow: true,
Previous: true,
......@@ -118,7 +118,7 @@ func TestPodLogOptions(t *testing.T) {
// query params -> unversioned
{
convertedLogOptions := &api.PodLogOptions{}
convertedLogOptions := &core.PodLogOptions{}
err := codec.DecodeParameters(expectedParameters, v1.SchemeGroupVersion, convertedLogOptions)
if err != nil {
t.Fatal(err)
......@@ -136,7 +136,7 @@ func TestPodSpecConversion(t *testing.T) {
// Test internal -> v1. Should have both alias (DeprecatedServiceAccount)
// and new field (ServiceAccountName).
i := &api.PodSpec{
i := &core.PodSpec{
ServiceAccountName: name,
}
v := v1.PodSpec{}
......@@ -164,13 +164,13 @@ func TestPodSpecConversion(t *testing.T) {
{ServiceAccountName: name, DeprecatedServiceAccount: other},
}
for k, v := range testCases {
got := api.PodSpec{}
got := core.PodSpec{}
err := legacyscheme.Scheme.Convert(v, &got, nil)
if err != nil {
t.Fatalf("unexpected error for case %d: %v", k, err)
}
if got.ServiceAccountName != name {
t.Fatalf("want api.ServiceAccountName %q, got %q", name, got.ServiceAccountName)
t.Fatalf("want core.ServiceAccountName %q, got %q", name, got.ServiceAccountName)
}
}
}
......@@ -181,7 +181,7 @@ func TestResourceListConversion(t *testing.T) {
tests := []struct {
input v1.ResourceList
expected api.ResourceList
expected core.ResourceList
}{
{ // No changes necessary.
input: v1.ResourceList{
......@@ -189,10 +189,10 @@ func TestResourceListConversion(t *testing.T) {
v1.ResourceCPU: resource.MustParse("100m"),
v1.ResourceStorage: resource.MustParse("1G"),
},
expected: api.ResourceList{
api.ResourceMemory: resource.MustParse("30M"),
api.ResourceCPU: resource.MustParse("100m"),
api.ResourceStorage: resource.MustParse("1G"),
expected: core.ResourceList{
core.ResourceMemory: resource.MustParse("30M"),
core.ResourceCPU: resource.MustParse("100m"),
core.ResourceStorage: resource.MustParse("1G"),
},
},
{ // Nano-scale values should be rounded up to milli-scale.
......@@ -200,9 +200,9 @@ func TestResourceListConversion(t *testing.T) {
v1.ResourceCPU: resource.MustParse("3.000023m"),
v1.ResourceMemory: resource.MustParse("500.000050m"),
},
expected: api.ResourceList{
api.ResourceCPU: resource.MustParse("4m"),
api.ResourceMemory: resource.MustParse("501m"),
expected: core.ResourceList{
core.ResourceCPU: resource.MustParse("4m"),
core.ResourceMemory: resource.MustParse("501m"),
},
},
{ // Large values should still be accurate.
......@@ -210,19 +210,19 @@ func TestResourceListConversion(t *testing.T) {
v1.ResourceCPU: *bigMilliQuantity.Copy(),
v1.ResourceStorage: *bigMilliQuantity.Copy(),
},
expected: api.ResourceList{
api.ResourceCPU: *bigMilliQuantity.Copy(),
api.ResourceStorage: *bigMilliQuantity.Copy(),
expected: core.ResourceList{
core.ResourceCPU: *bigMilliQuantity.Copy(),
core.ResourceStorage: *bigMilliQuantity.Copy(),
},
},
}
for i, test := range tests {
output := api.ResourceList{}
output := core.ResourceList{}
// defaulting is a separate step from conversion that is applied when reading from the API or from etcd.
// perform that step explicitly.
k8s_api_v1.SetDefaults_ResourceList(&test.input)
corev1.SetDefaults_ResourceList(&test.input)
err := legacyscheme.Scheme.Convert(&test.input, &output, nil)
if err != nil {
......@@ -306,14 +306,14 @@ func TestReplicationControllerConversion(t *testing.T) {
for _, in := range inputs {
rs := &extensions.ReplicaSet{}
// Use in.DeepCopy() to avoid sharing pointers with `in`.
if err := k8s_api_v1.Convert_v1_ReplicationController_to_extensions_ReplicaSet(in.DeepCopy(), rs, nil); err != nil {
if err := corev1.Convert_v1_ReplicationController_to_extensions_ReplicaSet(in.DeepCopy(), rs, nil); err != nil {
t.Errorf("can't convert RC to RS: %v", err)
continue
}
// Round-trip RS before converting back to RC.
rs = roundTripRS(t, rs)
out := &v1.ReplicationController{}
if err := k8s_api_v1.Convert_extensions_ReplicaSet_to_v1_ReplicationController(rs, out, nil); err != nil {
if err := corev1.Convert_extensions_ReplicaSet_to_v1_ReplicationController(rs, out, nil); err != nil {
t.Errorf("can't convert RS to RC: %v", err)
continue
}
......
......@@ -27,14 +27,14 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/api/legacyscheme"
k8s_api_v1 "k8s.io/kubernetes/pkg/api/v1"
corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
// enforce that all types are installed
_ "k8s.io/kubernetes/pkg/api/testapi"
)
func roundTrip(t *testing.T, obj runtime.Object) runtime.Object {
codec := legacyscheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)
codec := legacyscheme.Codecs.LegacyCodec(corev1.SchemeGroupVersion)
data, err := runtime.Encode(codec, obj)
if err != nil {
t.Errorf("%v\n %#v", err, obj)
......@@ -1129,7 +1129,7 @@ func TestSetMinimumScalePod(t *testing.T) {
pod := &v1.Pod{
Spec: s,
}
k8s_api_v1.SetObjectDefaults_Pod(pod)
corev1.SetObjectDefaults_Pod(pod)
if expect := resource.MustParse("1m"); expect.Cmp(pod.Spec.Containers[0].Resources.Requests[v1.ResourceMemory]) != 0 {
t.Errorf("did not round resources: %#v", pod.Spec.Containers[0].Resources)
......
......@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/api
// +k8s:conversion-gen-external-types=../../../vendor/k8s.io/api/core/v1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/core
// +k8s:conversion-gen-external-types=../../../../vendor/k8s.io/api/core/v1
// +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../vendor/k8s.io/api/core/v1
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/core/v1
// Package v1 is the v1 version of the API.
package v1 // import "k8s.io/kubernetes/pkg/api/v1"
package v1 // import "k8s.io/kubernetes/pkg/apis/core/v1"
......@@ -26,7 +26,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/api/helper"
"k8s.io/kubernetes/pkg/apis/core/helper"
)
// IsExtendedResourceName returns true if the resource name is not in the
......
......@@ -20,7 +20,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/sets"
v1helper "k8s.io/kubernetes/pkg/api/v1/helper"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
)
// QOSList is a set of (resource name, QoS class) pairs.
......
......@@ -22,9 +22,9 @@ import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/helper/qos"
k8sv1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/helper/qos"
corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
)
func TestGetPodQOS(t *testing.T) {
......@@ -142,11 +142,11 @@ func TestGetPodQOS(t *testing.T) {
t.Errorf("[%d]: invalid qos pod %s, expected: %s, actual: %s", id, testCase.pod.Name, testCase.expected, actual)
}
// Convert v1.Pod to api.Pod, and then check against `api.helper.GetPodQOS`.
pod := api.Pod{}
k8sv1.Convert_v1_Pod_To_api_Pod(testCase.pod, &pod, nil)
// Convert v1.Pod to core.Pod, and then check against `core.helper.GetPodQOS`.
pod := core.Pod{}
corev1.Convert_v1_Pod_To_api_Pod(testCase.pod, &pod, nil)
if actual := qos.GetPodQOS(&pod); api.PodQOSClass(testCase.expected) != actual {
if actual := qos.GetPodQOS(&pod); core.PodQOSClass(testCase.expected) != actual {
t.Errorf("[%d]: conversion invalid qos pod %s, expected: %s, actual: %s", id, testCase.pod.Name, testCase.expected, actual)
}
}
......
......@@ -27,8 +27,8 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api/helper"
v1helper "k8s.io/kubernetes/pkg/api/v1/helper"
"k8s.io/kubernetes/pkg/apis/core/helper"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
)
const isNegativeErrorMsg string = `must be greater than or equal to 0`
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,4 +16,4 @@ limitations under the License.
// Package validation has functions for validating the correctness of api
// objects and explaining what is wrong with them when they aren't valid.
package validation // import "k8s.io/kubernetes/pkg/api/validation"
package validation // import "k8s.io/kubernetes/pkg/apis/core/validation"
......@@ -24,12 +24,12 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/core"
)
// ValidateEvent makes sure that the event makes sense.
func ValidateEvent(event *api.Event) field.ErrorList {
func ValidateEvent(event *core.Event) field.ErrorList {
allErrs := field.ErrorList{}
// Make sure event.Namespace and the involvedObject.Namespace agree
......
......@@ -20,69 +20,69 @@ import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/core"
)
func TestValidateEvent(t *testing.T) {
table := []struct {
*api.Event
*core.Event
valid bool
}{
{
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test1",
Namespace: "foo",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
Namespace: "bar",
Kind: "Pod",
},
},
false,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test2",
Namespace: "aoeu-_-aoeu",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
Namespace: "aoeu-_-aoeu",
Kind: "Pod",
},
},
false,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test3",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "v1",
Kind: "Node",
},
},
true,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test4",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "v1",
Kind: "Namespace",
},
},
true,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test5",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "NoKind",
Namespace: metav1.NamespaceDefault,
......@@ -90,12 +90,12 @@ func TestValidateEvent(t *testing.T) {
},
true,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test6",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Job",
Namespace: "foo",
......@@ -103,12 +103,12 @@ func TestValidateEvent(t *testing.T) {
},
false,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test7",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "extensions/v1beta1",
Kind: "Job",
Namespace: metav1.NamespaceDefault,
......@@ -116,12 +116,12 @@ func TestValidateEvent(t *testing.T) {
},
true,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test8",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "other/v1beta1",
Kind: "Job",
Namespace: "foo",
......@@ -129,12 +129,12 @@ func TestValidateEvent(t *testing.T) {
},
false,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test9",
Namespace: "foo",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "other/v1beta1",
Kind: "Job",
Namespace: "foo",
......@@ -142,12 +142,12 @@ func TestValidateEvent(t *testing.T) {
},
true,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test10",
Namespace: metav1.NamespaceDefault,
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "extensions",
Kind: "Job",
Namespace: "foo",
......@@ -155,12 +155,12 @@ func TestValidateEvent(t *testing.T) {
},
false,
}, {
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test11",
Namespace: "foo",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
// must register in v1beta1 to be true
APIVersion: "extensions/v1beta1",
Kind: "Job",
......@@ -170,12 +170,12 @@ func TestValidateEvent(t *testing.T) {
true,
},
{
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test12",
Namespace: "foo",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "other/v1beta1",
Kind: "FooBar",
Namespace: "bar",
......@@ -184,12 +184,12 @@ func TestValidateEvent(t *testing.T) {
false,
},
{
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test13",
Namespace: "",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "other/v1beta1",
Kind: "FooBar",
Namespace: "bar",
......@@ -198,12 +198,12 @@ func TestValidateEvent(t *testing.T) {
false,
},
{
&api.Event{
&core.Event{
ObjectMeta: metav1.ObjectMeta{
Name: "test14",
Namespace: "foo",
},
InvolvedObject: api.ObjectReference{
InvolvedObject: core.ObjectReference{
APIVersion: "other/v1beta1",
Kind: "FooBar",
Namespace: "",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -18,7 +18,7 @@ limitations under the License.
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package api
package core
import (
resource "k8s.io/apimachinery/pkg/api/resource"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment