mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
rename legacy to core
This commit is contained in:
@@ -66,7 +66,7 @@ func (p *provision) Admit(a admission.Attributes) (err error) {
|
||||
if exists {
|
||||
return nil
|
||||
}
|
||||
_, err = p.client.Legacy().Namespaces().Create(namespace)
|
||||
_, err = p.client.Core().Namespaces().Create(namespace)
|
||||
if err != nil && !errors.IsAlreadyExists(err) {
|
||||
return admission.NewForbidden(a, err)
|
||||
}
|
||||
@@ -79,10 +79,10 @@ func NewProvision(c clientset.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
|
||||
return c.Legacy().Namespaces().List(options)
|
||||
return c.Core().Namespaces().List(options)
|
||||
},
|
||||
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
|
||||
return c.Legacy().Namespaces().Watch(options)
|
||||
return c.Core().Namespaces().Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Namespace{},
|
||||
|
||||
@@ -69,7 +69,7 @@ func (e *exists) Admit(a admission.Attributes) (err error) {
|
||||
}
|
||||
|
||||
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
|
||||
_, err = e.client.Legacy().Namespaces().Get(a.GetNamespace())
|
||||
_, err = e.client.Core().Namespaces().Get(a.GetNamespace())
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
return err
|
||||
@@ -86,10 +86,10 @@ func NewExists(c clientset.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
|
||||
return c.Legacy().Namespaces().List(options)
|
||||
return c.Core().Namespaces().List(options)
|
||||
},
|
||||
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
|
||||
return c.Legacy().Namespaces().Watch(options)
|
||||
return c.Core().Namespaces().Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Namespace{},
|
||||
|
||||
@@ -73,7 +73,7 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) {
|
||||
// refuse to operate on non-existent namespaces
|
||||
if !exists {
|
||||
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
|
||||
namespaceObj, err = l.client.Legacy().Namespaces().Get(a.GetNamespace())
|
||||
namespaceObj, err = l.client.Core().Namespaces().Get(a.GetNamespace())
|
||||
if err != nil {
|
||||
if errors.IsNotFound(err) {
|
||||
return err
|
||||
@@ -102,10 +102,10 @@ func NewLifecycle(c clientset.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
|
||||
return c.Legacy().Namespaces().List(options)
|
||||
return c.Core().Namespaces().List(options)
|
||||
},
|
||||
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
|
||||
return c.Legacy().Namespaces().Watch(options)
|
||||
return c.Core().Namespaces().Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Namespace{},
|
||||
|
||||
Reference in New Issue
Block a user