Skip to content

Commit

Permalink
Merge pull request #23 from jboyd01/v0.1.31-rebase-master
Browse files Browse the repository at this point in the history
V0.1.31 rebase master
  • Loading branch information
openshift-merge-robot authored Sep 6, 2018
2 parents df5a8b3 + 9079031 commit c0f3fe8
Show file tree
Hide file tree
Showing 65 changed files with 1,587 additions and 914 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion UPSTREAM-VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.30
v0.1.31
2 changes: 1 addition & 1 deletion charts/catalog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: catalog
description: service-catalog API server and controller-manager helm chart
version: 0.1.30
version: 0.1.31
7 changes: 4 additions & 3 deletions charts/catalog/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Service Catalog

Service Catalog is a Kubernetes Incubator project that provides a
Kubernetes-native workflow for integrating with
Kubernetes-native workflow for integrating with
[Open Service Brokers](https://www.openservicebrokerapi.org/)
to provision and bind to application dependencies like databases, object
storage, message-oriented middleware, and more.
Expand Down Expand Up @@ -40,16 +40,17 @@ chart and their default values.

| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | apiserver image to use | `quay.io/kubernetes-service-catalog/service-catalog:v0.1.30` |
| `image` | apiserver image to use | `quay.io/kubernetes-service-catalog/service-catalog:v0.1.31` |
| `imagePullPolicy` | `imagePullPolicy` for the service catalog | `Always` |
| `apiserver.annotations` | Annotations for apiserver pods | `{}` |
| `apiserver.nodeSelector` | A nodeSelector value to apply to the apiserver pods. If not specified, no nodeSelector will be applied | |
| `apiserver.aggregator.priority` | Priority of the APIService. | `100` |
| `apiserver.aggregator.groupPriorityMinimum` | The minimum priority the group should have. | `10000` |
| `apiserver.aggregator.versionPriority` | The ordering of this API inside of the group | `20` |
| `apiserver.tls.requestHeaderCA` | Base64-encoded CA used to validate request-header authentication, when receiving delegated authentication from an aggregator. If not set, the service catalog API server will inherit this CA from the `extension-apiserver-authentication` ConfigMap if available. | `nil` |
| `apiserver.service.type` | Type of service; valid values are `LoadBalancer` and `NodePort` | `NodePort` |
| `apiserver.service.type` | Type of service; valid values are `LoadBalancer` , `NodePort` and `ClusterIP` | `NodePort` |
| `apiserver.service.nodePort.securePort` | If service type is `NodePort`, specifies a port in allowable range (e.g. 30000 - 32767 on minikube); The TLS-enabled endpoint will be exposed here | `30443` |
| `apiserver.service.clusterIP` | If service type is ClusterIP, specify clusterIP as `None` for `headless services` OR specify your own specific IP OR leave blank to let Kubernetes assign a cluster IP | |
| `apiserver.storage.type` | The storage backend to use; the only valid value is `etcd`, left for other storages support in future, e.g. `crd` | `etcd` |
| `apiserver.storage.etcd.useEmbedded` | If storage type is `etcd`: Whether to embed an etcd container in the apiserver pod; THIS IS INADEQUATE FOR PRODUCTION USE! | `true` |
| `apiserver.storage.etcd.servers` | If storage type is `etcd`: etcd URL(s); override this if NOT using embedded etcd. Only etcd v3 is supported. | `http://localhost:2379` |
Expand Down
5 changes: 5 additions & 0 deletions charts/catalog/templates/apiserver-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ metadata:
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.apiserver.service.type }}
{{- if eq .Values.apiserver.service.type "ClusterIP" }}
{{- if .Values.apiserver.service.clusterIP }}
clusterIP: {{ .Values.apiserver.service.clusterIP }}
{{- end }}
{{- end }}
selector:
app: {{ template "fullname" . }}-apiserver
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/catalog/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for Service Catalog
# service-catalog image to use
image: quay.io/kubernetes-service-catalog/service-catalog:v0.1.30
image: quay.io/kubernetes-service-catalog/service-catalog:v0.1.31
# imagePullPolicy for the service-catalog; valid values are "IfNotPresent",
# "Never", and "Always"
imagePullPolicy: Always
Expand Down
2 changes: 1 addition & 1 deletion charts/ups-broker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Service Broker

| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.29` |
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.31` |
| `imagePullPolicy` | `imagePullPolicy` for the ups-broker | `Always` |

Specify each parameter using the `--set key=value[,key=value]` argument to
Expand Down
2 changes: 1 addition & 1 deletion charts/ups-broker/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for User-Provided Service Broker
# Image to use
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.29
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.31
# ImagePullPolicy; valid values are "IfNotPresent", "Never", and "Always"
imagePullPolicy: Always
# Whether the broker should also log to stderr instead of to files only
Expand Down
2 changes: 1 addition & 1 deletion cmd/svcat/broker/deregister_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ func (c *DeregisterCmd) Deregister() error {
return err
}

fmt.Fprintf(c.Context.Output, "Successfully removed broker %q", c.BrokerName)
fmt.Fprintf(c.Context.Output, "Successfully removed broker %q\n", c.BrokerName)
return nil
}
2 changes: 1 addition & 1 deletion cmd/svcat/broker/deregister_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var _ = Describe("Deregister Command", func() {
Expect(returnedName).To(Equal(brokerName))

output := outputBuffer.String()
Expect(output).To(Equal("Successfully removed broker \"foobarbroker\""))
Expect(output).To(Equal("Successfully removed broker \"foobarbroker\"\n"))
})
})
})
3 changes: 2 additions & 1 deletion cmd/svcat/class/describe_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/kubernetes-incubator/service-catalog/cmd/svcat/command"
"github.com/kubernetes-incubator/service-catalog/cmd/svcat/output"
"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1"
servicecatalog "github.com/kubernetes-incubator/service-catalog/pkg/svcat/service-catalog"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -88,7 +89,7 @@ func (c *describeCmd) describe() error {

output.WriteClassDetails(c.Output, class)

plans, err := c.App.RetrievePlansByClass(class)
plans, err := c.App.RetrievePlans(servicecatalog.RetrievePlanOptions{Scope: servicecatalog.AllScope, ClassID: class.Name})
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/svcat/instance/deprovision_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ func (c *deprovisonCmd) deprovision() error {
fmt.Fprintln(c.Output, "Waiting for the instance to be deleted...")

var instance *v1beta1.ServiceInstance
instance, err = c.App.WaitForInstance(c.Namespace, c.instanceName, c.Interval, c.Timeout)
instance, err = c.App.WaitForInstanceToNotExist(c.Namespace, c.instanceName, c.Interval, c.Timeout)

// The instance failed to deprovision cleanly, dump out more information on why
if c.App.IsInstanceFailed(instance) {
if instance != nil && c.App.IsInstanceFailed(instance) {
output.WriteInstanceDetails(c.Output, instance)
}
}
Expand Down
1 change: 1 addition & 0 deletions cmd/svcat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func buildRootCommand(cxt *command.Context) *cobra.Command {
cmd.AddCommand(newGetCmd(cxt))
cmd.AddCommand(newDescribeCmd(cxt))
cmd.AddCommand(broker.NewRegisterCmd(cxt))
cmd.AddCommand(broker.NewDeregisterCmd(cxt))
cmd.AddCommand(instance.NewProvisionCmd(cxt))
cmd.AddCommand(instance.NewDeprovisionCmd(cxt))
cmd.AddCommand(binding.NewBindCmd(cxt))
Expand Down
33 changes: 16 additions & 17 deletions cmd/svcat/output/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func getPlanStatusShort(status v1beta1.ClusterServicePlanStatus) string {

// ByAge implements sort.Interface for []Person based on
// the Age field.
type byClass []v1beta1.ClusterServicePlan
type byClass []servicecatalog.Plan

func (a byClass) Len() int {
return len(a)
Expand All @@ -44,45 +44,44 @@ func (a byClass) Swap(i, j int) {
a[i], a[j] = a[j], a[i]
}
func (a byClass) Less(i, j int) bool {
return a[i].Spec.ClusterServiceClassRef.Name < a[j].Spec.ClusterServiceClassRef.Name
return a[i].GetClassID() < a[j].GetClassID()
}

func writePlanListTable(w io.Writer, plans []v1beta1.ClusterServicePlan, classNames map[string]string) {
func writePlanListTable(w io.Writer, plans []servicecatalog.Plan, classNames map[string]string) {

sort.Sort(byClass(plans))

t := NewListTable(w)
t.SetHeader([]string{
"Name",
"Namespace",
"Class",
"Description",
})
for _, plan := range plans {
t.Append([]string{
plan.Spec.ExternalName,
classNames[plan.Spec.ClusterServiceClassRef.Name],
plan.Spec.Description,
plan.GetExternalName(),
plan.GetNamespace(),
classNames[plan.GetClassID()],
plan.GetDescription(),
})
}
t.SetVariableColumn(3)
t.SetVariableColumn(4)

t.Render()
}

// WritePlanList prints a list of plans in the specified output format.
func WritePlanList(w io.Writer, outputFormat string, plans []v1beta1.ClusterServicePlan, classes []servicecatalog.Class) {
func WritePlanList(w io.Writer, outputFormat string, plans []servicecatalog.Plan, classes []servicecatalog.Class) {
classNames := map[string]string{}
for _, class := range classes {
classNames[class.GetName()] = class.GetExternalName()
}
list := v1beta1.ClusterServicePlanList{
Items: plans,
}
switch outputFormat {
case FormatJSON:
writeJSON(w, list)
writeJSON(w, plans)
case FormatYAML:
writeYAML(w, list, 0)
writeYAML(w, plans, 0)
case FormatTable:
writePlanListTable(w, plans, classNames)
}
Expand All @@ -99,12 +98,12 @@ func WritePlan(w io.Writer, outputFormat string, plan v1beta1.ClusterServicePlan
case FormatTable:
classNames := map[string]string{}
classNames[class.Name] = class.Spec.ExternalName
writePlanListTable(w, []v1beta1.ClusterServicePlan{plan}, classNames)
writePlanListTable(w, []servicecatalog.Plan{&plan}, classNames)
}
}

// WriteAssociatedPlans prints a list of plans associated with a class.
func WriteAssociatedPlans(w io.Writer, plans []v1beta1.ClusterServicePlan) {
func WriteAssociatedPlans(w io.Writer, plans []servicecatalog.Plan) {
fmt.Fprintln(w, "\nPlans:")
if len(plans) == 0 {
fmt.Fprintln(w, "No plans defined")
Expand All @@ -118,8 +117,8 @@ func WriteAssociatedPlans(w io.Writer, plans []v1beta1.ClusterServicePlan) {
})
for _, plan := range plans {
t.Append([]string{
plan.Spec.ExternalName,
plan.Spec.Description,
plan.GetExternalName(),
plan.GetDescription(),
})
}
t.Render()
Expand Down
29 changes: 18 additions & 11 deletions cmd/svcat/plan/get_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import (
)

type getCmd struct {
*command.Context
*command.Namespaced
*command.Scoped
*command.Formatted
lookupByUUID bool
uuid string
Expand All @@ -40,17 +41,20 @@ type getCmd struct {
}

// NewGetCmd builds a "svcat get plans" command
func NewGetCmd(cxt *command.Context) *cobra.Command {
func NewGetCmd(ctx *command.Context) *cobra.Command {
getCmd := &getCmd{
Context: cxt,
Formatted: command.NewFormatted(),
Namespaced: command.NewNamespaced(ctx),
Scoped: command.NewScoped(),
Formatted: command.NewFormatted(),
}
cmd := &cobra.Command{
Use: "plans [NAME]",
Aliases: []string{"plan", "pl"},
Short: "List plans, optionally filtered by name or class",
Short: "List plans, optionally filtered by name, class, scope or namespace",
Example: command.NormalizeExamples(`
svcat get plans
svcat get plans --scope cluster
svcat get plans --scope namespace --namespace dev
svcat get plan PLAN_NAME
svcat get plan CLASS_NAME/PLAN_NAME
svcat get plan --uuid PLAN_UUID
Expand All @@ -77,6 +81,8 @@ func NewGetCmd(cxt *command.Context) *cobra.Command {
"Filter plans based on class. When --uuid is specified, the class name is interpreted as a uuid.",
)
getCmd.AddOutputFlags(cmd.Flags())
getCmd.AddNamespaceFlags(cmd.Flags(), true)
getCmd.AddScopedFlags(cmd.Flags(), true)
return cmd
}

Expand Down Expand Up @@ -117,16 +123,19 @@ func (c *getCmd) Run() error {
func (c *getCmd) getAll() error {

// Retrieve the classes as well because plans don't have the external class name
// TODO: When we implement ns-scoped support for get plans, we need to pass in the current namespace
classOpts := servicecatalog.ScopeOptions{
Scope: servicecatalog.AllScope,
Namespace: c.Namespace,
Scope: c.Scope,
}
classes, err := c.App.RetrieveClasses(classOpts)
if err != nil {
return fmt.Errorf("unable to list classes (%s)", err)
}

var opts *servicecatalog.FilterOptions
opts := servicecatalog.RetrievePlanOptions{
Namespace: c.Namespace,
Scope: c.Scope,
}
if c.classFilter != "" {
if !c.lookupByUUID {
// Map the external class name to the class name.
Expand All @@ -137,9 +146,7 @@ func (c *getCmd) getAll() error {
}
}
}
opts = &servicecatalog.FilterOptions{
ClassID: c.classUUID,
}
opts.ClassID = c.classUUID
}

plans, err := c.App.RetrievePlans(opts)
Expand Down
Loading

0 comments on commit c0f3fe8

Please sign in to comment.