Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Core() is deprecated use CoreV1() instead. #1701

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/nginx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions internal/k8s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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{}) {
Expand Down