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

Vendored in latest package for cluster-api #395

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ require (
github.com/kubernetes-csi/external-snapshotter/client/v6 v6.2.0
github.com/tektoncd/pipeline v0.56.0
google.golang.org/api v0.156.0
sigs.k8s.io/cluster-api v0.2.11
sigs.k8s.io/cluster-api v1.7.3
)

require (
Expand Down
20 changes: 10 additions & 10 deletions k8s/anthos/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"encoding/json"
"fmt"

v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/deprecated/v1alpha1"
v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
clusterResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "clusters"}
clusterResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1beta1", Resource: "clusters"}
)

type IpBlock struct {
Expand Down Expand Up @@ -58,17 +58,17 @@ type ClusterProviderConfig struct {
// ClusterOps is an interface to perform k8s cluster operations
type ClusterOps interface {
// ListCluster lists all kubernetes clusters
ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error)
ListCluster(ctx context.Context) (*v1beta1.ClusterList, error)
// GetCluster returns a cluster for the given name
GetCluster(ctx context.Context, name, namespace string) (*v1alpha1.Cluster, error)
GetCluster(ctx context.Context, name, namespace string) (*v1beta1.Cluster, error)
// GetClusterStatus return the given cluster status
GetClusterStatus(ctx context.Context, name, namespace string) (*v1alpha1.ClusterStatus, error)
GetClusterStatus(ctx context.Context, name, namespace string) (*v1beta1.ClusterStatus, error)
// GetClusterProviderSpec return cluster provider spec
GetClusterProviderSpec(ctx context.Context, name, namespace string) (*ClusterProviderConfig, error)
}

// ListCluster lists all kubernetes clusters
func (c *Client) ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error) {
func (c *Client) ListCluster(ctx context.Context) (*v1beta1.ClusterList, error) {
if err := c.initClient(); err != nil {
return nil, err
}
Expand All @@ -81,7 +81,7 @@ func (c *Client) ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error)
if err != nil {
return nil, err
}
clusterList := &v1alpha1.ClusterList{}
clusterList := &v1beta1.ClusterList{}
if err := json.Unmarshal(jsonData, clusterList); err != nil {
return nil, err
}
Expand All @@ -90,7 +90,7 @@ func (c *Client) ListCluster(ctx context.Context) (*v1alpha1.ClusterList, error)
}

// GetCluster returns a cluster for the given name
func (c *Client) GetCluster(ctx context.Context, name, namespace string) (*v1alpha1.Cluster, error) {
func (c *Client) GetCluster(ctx context.Context, name, namespace string) (*v1beta1.Cluster, error) {
if err := c.initClient(); err != nil {
return nil, err
}
Expand All @@ -102,15 +102,15 @@ func (c *Client) GetCluster(ctx context.Context, name, namespace string) (*v1alp
if err != nil {
return nil, err
}
cluster := &v1alpha1.Cluster{}
cluster := &v1beta1.Cluster{}
if err := json.Unmarshal(jsonData, cluster); err != nil {
return nil, err
}
return cluster, nil
}

// GetClusterStatus return the given cluster status
func (c *Client) GetClusterStatus(ctx context.Context, name, namespace string) (*v1alpha1.ClusterStatus, error) {
func (c *Client) GetClusterStatus(ctx context.Context, name, namespace string) (*v1beta1.ClusterStatus, error) {
cluster, err := c.GetCluster(ctx, name, namespace)
if err != nil {
return nil, err
Expand Down
18 changes: 8 additions & 10 deletions k8s/anthos/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ package anthos
import (
"context"
"encoding/json"

v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/deprecated/v1alpha1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

var (
machineResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "machines"}
machineResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1beta1", Resource: "machines"}
)

const (
Expand All @@ -21,15 +19,15 @@ const (
// MachinesOps is an interface to perform k8s machines operations
type MachineOps interface {
// ListMachines lists all machines in kubernetes cluster
ListMachines(ctx context.Context) (*v1alpha1.MachineList, error)
ListMachines(ctx context.Context) (*v1beta1.MachineList, error)
// GetMachine returns a machine for the given name
GetMachine(ctx context.Context, name string) (*v1alpha1.Machine, error)
GetMachine(ctx context.Context, name string) (*v1beta1.Machine, error)
// DeleteMachine delete machine for given name
DeleteMachine(ctx context.Context, name string) error
}

// ListMachines lists all machines in kubernetes cluster
func (c *Client) ListMachines(ctx context.Context) (*v1alpha1.MachineList, error) {
func (c *Client) ListMachines(ctx context.Context) (*v1beta1.MachineList, error) {
if err := c.initClient(); err != nil {
return nil, err
}
Expand All @@ -42,7 +40,7 @@ func (c *Client) ListMachines(ctx context.Context) (*v1alpha1.MachineList, error
if err != nil {
return nil, err
}
machineList := &v1alpha1.MachineList{}
machineList := &v1beta1.MachineList{}
if err := json.Unmarshal(jsonData, machineList); err != nil {
return nil, err
}
Expand All @@ -51,7 +49,7 @@ func (c *Client) ListMachines(ctx context.Context) (*v1alpha1.MachineList, error
}

// GetMachine returns a machine for the given name
func (c *Client) GetMachine(ctx context.Context, name string) (*v1alpha1.Machine, error) {
func (c *Client) GetMachine(ctx context.Context, name string) (*v1beta1.Machine, error) {
if err := c.initClient(); err != nil {
return nil, err
}
Expand All @@ -63,7 +61,7 @@ func (c *Client) GetMachine(ctx context.Context, name string) (*v1alpha1.Machine
if err != nil {
return nil, err
}
machine := &v1alpha1.Machine{}
machine := &v1beta1.Machine{}
if err := json.Unmarshal(jsonData, machine); err != nil {
return nil, err
}
Expand Down
202 changes: 202 additions & 0 deletions vendor/cloud.google.com/go/compute/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions vendor/cloud.google.com/go/compute/internal/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions vendor/cloud.google.com/go/compute/metadata/CHANGES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading