fix: Core() is deprecated use CoreV1() instead.
This commit is contained in:
parent
94487ca1b7
commit
b3cec74e79
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)
|
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 err != nil {
|
||||||
if strings.Contains(err.Error(), "cannot get services in the namespace") {
|
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")
|
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
|
// GetNodeIPOrName returns the IP address or the name of a node in the cluster
|
||||||
func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP bool) string {
|
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 {
|
if err != nil {
|
||||||
return ""
|
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")
|
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 {
|
if pod == nil {
|
||||||
return nil, fmt.Errorf("unable to get POD information")
|
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 {
|
func (f *Framework) WaitForPodsReady(timeout time.Duration, expectedReplicas int, opts metav1.ListOptions) error {
|
||||||
return wait.Poll(time.Second, timeout, func() (bool, 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 {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ func CreateKubeNamespace(baseName string, c kubernetes.Interface) (*v1.Namespace
|
||||||
var got *v1.Namespace
|
var got *v1.Namespace
|
||||||
err := wait.PollImmediate(Poll, defaultTimeout, func() (bool, error) {
|
err := wait.PollImmediate(Poll, defaultTimeout, func() (bool, error) {
|
||||||
var err error
|
var err error
|
||||||
got, err = c.Core().Namespaces().Create(ns)
|
got, err = c.CoreV1().Namespaces().Create(ns)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Logf("Unexpected error while creating namespace: %v", err)
|
Logf("Unexpected error while creating namespace: %v", err)
|
||||||
return false, nil
|
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
|
// DeleteKubeNamespace deletes a namespace and all the objects inside
|
||||||
func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error {
|
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{}) {
|
func ExpectNoError(err error, explain ...interface{}) {
|
||||||
|
|
Loading…
Reference in a new issue