Merge pull request #1701 from oilbeater/fix/remove_deprecated
fix: Core() is deprecated use CoreV1() instead.
This commit is contained in:
commit
1e0760ce95
4 changed files with 6 additions and 6 deletions
|
@ -68,7 +68,7 @@ func main() {
|
|||
glog.Fatalf("invalid format for service %v: %v", conf.DefaultService, err)
|
||||
}
|
||||
|
||||
_, err = kubeClient.Core().Services(ns).Get(name, metav1.GetOptions{})
|
||||
_, err = kubeClient.CoreV1().Services(ns).Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "cannot get services in the namespace") {
|
||||
glog.Fatalf("✖ It seems the cluster it is running with Authorization enabled (like RBAC) and there is no permissions for the ingress controller. Please check the configuration")
|
||||
|
|
|
@ -38,7 +38,7 @@ func ParseNameNS(input string) (string, string, error) {
|
|||
|
||||
// GetNodeIPOrName returns the IP address or the name of a node in the cluster
|
||||
func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP bool) string {
|
||||
node, err := kubeClient.Core().Nodes().Get(name, metav1.GetOptions{})
|
||||
node, err := kubeClient.CoreV1().Nodes().Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ func GetPodDetails(kubeClient clientset.Interface) (*PodInfo, error) {
|
|||
return nil, fmt.Errorf("unable to get POD information (missing POD_NAME or POD_NAMESPACE environment variable")
|
||||
}
|
||||
|
||||
pod, _ := kubeClient.Core().Pods(podNs).Get(podName, metav1.GetOptions{})
|
||||
pod, _ := kubeClient.CoreV1().Pods(podNs).Get(podName, metav1.GetOptions{})
|
||||
if pod == nil {
|
||||
return nil, fmt.Errorf("unable to get POD information")
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ func (f *Framework) EnsureDeployment(deployment *extensions.Deployment) (*extens
|
|||
|
||||
func (f *Framework) WaitForPodsReady(timeout time.Duration, expectedReplicas int, opts metav1.ListOptions) error {
|
||||
return wait.Poll(time.Second, timeout, func() (bool, error) {
|
||||
pl, err := f.KubeClientSet.Core().Pods(f.Namespace.Name).List(opts)
|
||||
pl, err := f.KubeClientSet.CoreV1().Pods(f.Namespace.Name).List(opts)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func CreateKubeNamespace(baseName string, c kubernetes.Interface) (*v1.Namespace
|
|||
var got *v1.Namespace
|
||||
err := wait.PollImmediate(Poll, defaultTimeout, func() (bool, error) {
|
||||
var err error
|
||||
got, err = c.Core().Namespaces().Create(ns)
|
||||
got, err = c.CoreV1().Namespaces().Create(ns)
|
||||
if err != nil {
|
||||
Logf("Unexpected error while creating namespace: %v", err)
|
||||
return false, nil
|
||||
|
@ -121,7 +121,7 @@ func CreateKubeNamespace(baseName string, c kubernetes.Interface) (*v1.Namespace
|
|||
|
||||
// DeleteKubeNamespace deletes a namespace and all the objects inside
|
||||
func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error {
|
||||
return c.Core().Namespaces().Delete(namespace, metav1.NewDeleteOptions(0))
|
||||
return c.CoreV1().Namespaces().Delete(namespace, metav1.NewDeleteOptions(0))
|
||||
}
|
||||
|
||||
func ExpectNoError(err error, explain ...interface{}) {
|
||||
|
|
Loading…
Reference in a new issue