Skip to content

Commit

Permalink
Merge pull request #5731 from lblackstone/openstack-state-delete
Browse files Browse the repository at this point in the history
OpenStack: enable cluster state deletion
  • Loading branch information
k8s-ci-robot committed Aug 31, 2018
2 parents cbd5c15 + 206d95d commit 153e561
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions hack/.packages
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions pkg/resources/openstack/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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",
],
)
32 changes: 32 additions & 0 deletions pkg/resources/openstack/resources.go
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 2 additions & 0 deletions pkg/resources/ops/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
4 changes: 4 additions & 0 deletions pkg/resources/ops/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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:
Expand Down

0 comments on commit 153e561

Please sign in to comment.