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

refactor(provider/oracle, storage/oracle): oraclebmcs provider/storage is renamed to oracle #959

Merged
merged 6 commits into from
Jun 6, 2018

Conversation

guoyongzhang
Copy link
Contributor

oraclebmcs provider is renamed to oracle; oraclebmcs storage is renamed to oracle.

@@ -250,15 +250,15 @@
* [**hal config provider openstack bakery edit**](#hal-config-provider-openstack-bakery-edit)
* [**hal config provider openstack disable**](#hal-config-provider-openstack-disable)
* [**hal config provider openstack enable**](#hal-config-provider-openstack-enable)
* [**hal config provider oraclebmcs**](#hal-config-provider-oraclebmcs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried this kind of renaming will break any existing users... is this necessary?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not strictly necessary, but it is highly desirable from our point of view. The original name was probably an unfortunate choice, and was tied to a name that is no longer used. So leaving it as it is could also cause possible confusion. I would like to suffer any pain now while it is hopefully a smaller impact of changing this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this change would force people who do not even use that provider to take some action, like update their hal config file, then we would definitely not want to do that.

@guoyongzhang guoyongzhang changed the title refactor(provider/oracle, storage/oracle): oraclebmcs provider/storage is renamed to oracle refactor(provider/oracle, storage/oracle): oraclebmcs provider/storage is renamed to oracle (Work in Progess) Jun 4, 2018
@guoyongzhang
Copy link
Contributor Author

The provider/storage config will read both old name (oraclebmcs) and new name (oracle), and consolidate them under just new name (oracle) for hal config to display and hal deploy to generate deployment files. With this PR, spinnaker with old oraclebmcs provider/storage config should be ported to the new name "oracle" automatically.

@guoyongzhang guoyongzhang changed the title refactor(provider/oracle, storage/oracle): oraclebmcs provider/storage is renamed to oracle (Work in Progess) refactor(provider/oracle, storage/oracle): oraclebmcs provider/storage is renamed to oracle Jun 4, 2018
Copy link
Member

@lwander lwander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, one comment about the iterator

@Override
public NodeIterator getChildren() {
return NodeIteratorFactory.makeReflectiveIterator(this);
List<Node> nodes = new ArrayList<Node>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep using reflective iterator, but maybe extend it to take preconditions? e.g. name != oraclebmcs. Otherwise this just adds to the overhead for adding a new provider.

nodes.add(gcs);
nodes.add(redis);
nodes.add(s3);
nodes.add(OraclePersistentStore.mergeOracleBMCSPersistentStore(oracle, oraclebmcs));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here about relying on the reflective iterator

@guoyongzhang
Copy link
Contributor Author

changes made according to the suggestion.

@guoyongzhang
Copy link
Contributor Author

Please review. This PR contains multiple commits, should I squash them or the merge can do it?

@markxnelson
Copy link

LGTM

@@ -46,16 +51,35 @@
GoogleProvider google = new GoogleProvider();
KubernetesProvider kubernetes = new KubernetesProvider();
OpenstackProvider openstack = new OpenstackProvider();
@JsonProperty(access = Access.WRITE_ONLY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is write only, and someone has the written in their halconfig, how does halyard read it to do the merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to JsonProperty.Access javadoc: WRITE_ONLY means that the property may only be written (set) for deserialization, but will not be read (get) on serialization, that is, the value of the property is not included in serialization.
So, the existing "oraclebmcs" will be deserialized into PersistenceStorage and will be consolidated with the deserialized "oracle" to produce a new "oracle" for serialization. The serialized "persistentStorage" will not contain "oraclebmcs".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks

@lwander
Copy link
Member

lwander commented Jun 6, 2018

I can squash the commits as a part of the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants