Merge pull request #5731 from lblackstone/openstack-state-delete

OpenStack: enable cluster state deletion
This commit is contained in:
k8s-ci-robot 2018-08-31 08:42:28 -07:00 committed by GitHub
commit 153e5615ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 0 deletions

View File

@ -116,6 +116,7 @@ k8s.io/kops/pkg/resources/aws
k8s.io/kops/pkg/resources/digitalocean
k8s.io/kops/pkg/resources/digitalocean/dns
k8s.io/kops/pkg/resources/gce
k8s.io/kops/pkg/resources/openstack
k8s.io/kops/pkg/resources/ops
k8s.io/kops/pkg/sshcredentials
k8s.io/kops/pkg/systemd

View File

@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["resources.go"],
importpath = "k8s.io/kops/pkg/resources/openstack",
visibility = ["//visibility:public"],
deps = [
"//pkg/resources:go_default_library",
"//upup/pkg/fi/cloudup/openstack:go_default_library",
],
)

View File

@ -0,0 +1,32 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package openstack
import (
"k8s.io/kops/pkg/resources"
"k8s.io/kops/upup/pkg/fi/cloudup/openstack"
)
type listFn func(openstack.OpenstackCloud, string) ([]*resources.Resource, error)
func ListResources(cloud openstack.OpenstackCloud, clusterName string) (map[string]*resources.Resource, error) {
resourceTrackers := make(map[string]*resources.Resource)
// TODO(lmb): Implement resource list
return resourceTrackers, nil
}

View File

@ -14,9 +14,11 @@ go_library(
"//pkg/resources/aws:go_default_library",
"//pkg/resources/digitalocean:go_default_library",
"//pkg/resources/gce:go_default_library",
"//pkg/resources/openstack:go_default_library",
"//upup/pkg/fi:go_default_library",
"//upup/pkg/fi/cloudup/awsup:go_default_library",
"//upup/pkg/fi/cloudup/gce:go_default_library",
"//upup/pkg/fi/cloudup/openstack:go_default_library",
"//upup/pkg/fi/cloudup/vsphere:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
],

View File

@ -24,9 +24,11 @@ import (
"k8s.io/kops/pkg/resources/aws"
"k8s.io/kops/pkg/resources/digitalocean"
"k8s.io/kops/pkg/resources/gce"
"k8s.io/kops/pkg/resources/openstack"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
cloudgce "k8s.io/kops/upup/pkg/fi/cloudup/gce"
cloudopenstack "k8s.io/kops/upup/pkg/fi/cloudup/openstack"
"k8s.io/kops/upup/pkg/fi/cloudup/vsphere"
)
@ -39,6 +41,8 @@ func ListResources(cloud fi.Cloud, clusterName string, region string) (map[strin
return digitalocean.ListResources(cloud.(*digitalocean.Cloud), clusterName)
case kops.CloudProviderGCE:
return gce.ListResourcesGCE(cloud.(cloudgce.GCECloud), clusterName, region)
case kops.CloudProviderOpenstack:
return openstack.ListResources(cloud.(cloudopenstack.OpenstackCloud), clusterName)
case kops.CloudProviderVSphere:
return resources.ListResourcesVSphere(cloud.(*vsphere.VSphereCloud), clusterName)
default: