Skip to content

Commit 1cdf105

Browse files
author
Tim McNamara
committed
Remove Oracle clouds (oracle, oci) from juju add-cloud
This commit removes the "oracle" and "oci" provider from juju add-cloud's list of clouds suppored by the interactive prompt.
1 parent c44e316 commit 1cdf105

File tree

6 files changed

+69
-54
lines changed

6 files changed

+69
-54
lines changed

cmd/juju/cloud/add.go

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,63 @@ type CloudMetadataStore interface {
3333
}
3434

3535
var usageAddCloudSummary = `
36-
Adds a user-defined cloud to Juju from among known cloud types.`[1:]
36+
Adds a cloud definition to Juju.
37+
`[1:]
3738

3839
var usageAddCloudDetails = `
40+
Juju needs to know how to connect to clouds. A cloud definition
41+
describes a cloud's endpoints and authentication requirements. Each
42+
definition is stored and accessed later as <cloud name>.
43+
44+
If you are accessing a public cloud, running add-cloud unlikely to be
45+
necessary. Juju already contains definitions for the public cloud
46+
providers it supports.
47+
48+
add-cloud operates in two modes:
49+
50+
juju add-cloud
51+
juju add-cloud <cloud name> <cloud definition file>
52+
53+
When invoked without arguments, add-cloud begins an interactive session
54+
designed for working with private clouds. The session will enable you
55+
to instruct Juju how to connect to your private cloud.
56+
57+
When <cloud definition file> is provided with <cloud name>,
58+
Juju stores that definition its internal cache directly after
59+
validating the contents.
60+
61+
If <cloud name> already exists in Juju's cache, then the `[1:] + "`--replace`" + `
62+
flag is required.
63+
3964
A cloud definition file has the following YAML format:
4065
41-
clouds:
42-
mycloud:
43-
type: openstack
66+
clouds: # mandatory
67+
mycloud: # <cloud name> argument
68+
type: openstack # <cloud type>, see below
4469
auth-types: [ userpass ]
4570
regions:
4671
london:
4772
endpoint: https://london.mycloud.com:35574/v3.0/
4873
49-
If the named cloud already exists, the `[1:] + "`--replace`" + ` option is required to
50-
overwrite its configuration.
51-
Known cloud types: azure, cloudsigma, ec2, gce, joyent, lxd, maas, manual,
52-
openstack, rackspace
74+
<cloud types> for private clouds:
75+
- lxd
76+
- maas
77+
- manual
78+
- openstack
79+
- vsphere
80+
81+
<cloud types> for public clouds:
82+
- azure
83+
- cloudsigma
84+
- ec2
85+
- gce
86+
- joyent
87+
- oci
5388
5489
Examples:
90+
juju add-cloud
5591
juju add-cloud mycloud ~/mycloud.yaml
92+
juju add-cloud --replace mycloud ~/mycloud2.yaml
5693
5794
See also:
5895
clouds`
@@ -108,7 +145,7 @@ func (c *AddCloudCommand) Info() *cmd.Info {
108145
// SetFlags initializes the flags supported by the command.
109146
func (c *AddCloudCommand) SetFlags(f *gnuflag.FlagSet) {
110147
c.CommandBase.SetFlags(f)
111-
f.BoolVar(&c.Replace, "replace", false, "Overwrite any existing cloud information")
148+
f.BoolVar(&c.Replace, "replace", false, "Overwrite any existing cloud information for <cloud name>")
112149
f.StringVar(&c.CloudFile, "f", "", "The path to a cloud definition file")
113150
}
114151

cmd/juju/cloud/add_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ func (*addSuite) TestInteractive(c *gc.C) {
323323
" lxd\n"+
324324
" maas\n"+
325325
" manual\n"+
326-
" oci\n"+
327326
" openstack\n"+
328-
" oracle\n"+
329327
" vsphere\n"+
330328
"\n"+
331329
"Select cloud type: \n",

provider/oci/provider.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ type environConfig struct {
4141
var _ config.ConfigSchemaSource = (*EnvironProvider)(nil)
4242
var _ environs.ProviderSchema = (*EnvironProvider)(nil)
4343

44-
var cloudSchema = &jsonschema.Schema{
45-
Type: []jsonschema.Type{jsonschema.ObjectType},
46-
Required: []string{cloud.RegionsKey, cloud.AuthTypesKey},
47-
Order: []string{cloud.RegionsKey, cloud.AuthTypesKey},
48-
Properties: map[string]*jsonschema.Schema{
49-
cloud.RegionsKey: {
50-
Type: []jsonschema.Type{jsonschema.ObjectType},
51-
Singular: "region",
52-
Plural: "regions",
53-
AdditionalProperties: &jsonschema.Schema{
54-
Type: []jsonschema.Type{jsonschema.ObjectType},
55-
},
56-
},
57-
cloud.AuthTypesKey: {
58-
// don't need a prompt, since there's only one choice.
59-
Type: []jsonschema.Type{jsonschema.ArrayType},
60-
Enum: []interface{}{[]string{string(cloud.HTTPSigAuthType)}},
61-
},
62-
},
63-
}
44+
// var cloudSchema = &jsonschema.Schema{
45+
// Type: []jsonschema.Type{jsonschema.ObjectType},
46+
// Required: []string{cloud.RegionsKey, cloud.AuthTypesKey},
47+
// Order: []string{cloud.RegionsKey, cloud.AuthTypesKey},
48+
// Properties: map[string]*jsonschema.Schema{
49+
// cloud.RegionsKey: {
50+
// Type: []jsonschema.Type{jsonschema.ObjectType},
51+
// Singular: "region",
52+
// Plural: "regions",
53+
// AdditionalProperties: &jsonschema.Schema{
54+
// Type: []jsonschema.Type{jsonschema.ObjectType},
55+
// },
56+
// },
57+
// cloud.AuthTypesKey: {
58+
// // don't need a prompt, since there's only one choice.
59+
// Type: []jsonschema.Type{jsonschema.ArrayType},
60+
// Enum: []interface{}{[]string{string(cloud.HTTPSigAuthType)}},
61+
// },
62+
// },
63+
// }
6464

6565
var configSchema = environschema.Fields{
6666
"compartment-id": {
@@ -188,7 +188,7 @@ func (e EnvironProvider) Version() int {
188188

189189
// CloudSchema implements environs.EnvironProvider.
190190
func (e EnvironProvider) CloudSchema() *jsonschema.Schema {
191-
return cloudSchema
191+
return nil
192192
}
193193

194194
// Ping implements environs.EnvironProvider.

provider/oracle/export_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var (
1212
DefaultStorageProviderType = oracleStorageProviderType
1313
OracleVolumeType = oracleVolumeType
1414
OracleLatencyPool = latencyPool
15-
OracleCloudSchema = cloudSchema
1615
OracleCredentials = credentials
1716
NewOracleVolumeSource = newOracleVolumeSource
1817
NewOracleInstance = newInstance

provider/oracle/provider.go

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,9 @@ type EnvironProvider struct{}
2828

2929
var _ environs.CloudEnvironProvider = (*EnvironProvider)(nil)
3030

31-
var cloudSchema = &jsonschema.Schema{
32-
Type: []jsonschema.Type{jsonschema.ObjectType},
33-
Required: []string{cloud.EndpointKey, cloud.AuthTypesKey},
34-
Order: []string{cloud.EndpointKey, cloud.AuthTypesKey},
35-
Properties: map[string]*jsonschema.Schema{
36-
cloud.EndpointKey: {
37-
Singular: "the API endpoint url for the cloud",
38-
Type: []jsonschema.Type{jsonschema.StringType},
39-
Format: jsonschema.FormatURI,
40-
},
41-
cloud.AuthTypesKey: {
42-
// don't need a prompt, since there's only one choice.
43-
Type: []jsonschema.Type{jsonschema.ArrayType},
44-
Enum: []interface{}{[]string{string(cloud.UserPassAuthType)}},
45-
},
46-
},
47-
}
48-
4931
// CloudSchema is defined on the environs.EnvironProvider interface.
5032
func (e EnvironProvider) CloudSchema() *jsonschema.Schema {
51-
return cloudSchema
33+
return nil
5234
}
5335

5436
// Ping implements environs.EnvironProvider.

provider/oracle/provider_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ func (e *environProviderSuite) NewProvider(c *gc.C) environs.EnvironProvider {
3232
func (e *environProviderSuite) TestCloudSchma(c *gc.C) {
3333
provider := e.NewProvider(c)
3434
schema := provider.CloudSchema()
35-
c.Assert(schema, gc.NotNil)
36-
c.Assert(schema, jc.DeepEquals, oracle.OracleCloudSchema)
35+
c.Assert(schema, gc.IsNil)
3736
}
3837

3938
func (e *environProviderSuite) TestPing(c *gc.C) {

0 commit comments

Comments
 (0)