Skip to content

[WIP] Initial secrets protobuf changes and dispatcher support#1377

Closed
aaronlehmann wants to merge 4 commits intomoby:masterfrom
aaronlehmann:secrets-streaming
Closed

[WIP] Initial secrets protobuf changes and dispatcher support#1377
aaronlehmann wants to merge 4 commits intomoby:masterfrom
aaronlehmann:secrets-streaming

Conversation

@aaronlehmann
Copy link
Collaborator

Add a Secret top-level object type. Add a SecretReference that allows a
service to reference the secrets it needs.

Add dispatcher Assignments method which will replace Tasks going
forward. This provides a stream with incremental task and secret
updates. Additional object types can be supported in the assignment set
in the future. The first message returned from the Assignments stream is
the complete set of tasks and secrets for the node, and this is used to
synchronize the node's view with the manager's. Additional messages
returned by the stream are incremental updates that add, update, or
remove one or more tasks or secrets. If the agent gets out of sync with
the manager, it can reinitiate the Assignments stream to sync up.

// starts at 0 and increments. If a sequence number is skipped, the
// consumer of the stream should start a new Assignments stream to
// re-sync.
int64 sequence = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just make this an opaque string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should there be two opaque strings - one identifying the current message and another to match with the previous message?

Copy link
Contributor

Choose a reason for hiding this comment

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

That will sure make it easier to debug if there is an "applies to" and "results in" field.

@stevvooe
Copy link
Contributor

This is a fantastic looking start.

@aaronlehmann
Copy link
Collaborator Author

Thanks for the comments. I will make some changes tomorrow.

@codecov-io
Copy link

codecov-io commented Aug 16, 2016

Current coverage is 53.76% (diff: 11.95%)

Merging #1377 into master will decrease coverage by 1.28%

@@             master      #1377   diff @@
==========================================
  Files            81         82     +1   
  Lines         12850      13199   +349   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7074       7096    +22   
- Misses         4793       5115   +322   
- Partials        983        988     +5   

Sunburst

Powered by Codecov. Last update 06c7477...b57ff7e

api/types.proto Outdated
string target = 2;

// SecretName is the name of the secret that this reference.
string secret_name = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can just call this "name" or "reference" and maybe it comes first.

@aaronlehmann
Copy link
Collaborator Author

Made some of the updates such as AppliesTo and ResultsIn. Waiting for @diogomonica's thoughts on some of the naming issues.

}

// SecretReference is the linkage between a service and a secret that it uses.
message SecretReference {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way to reference a group or tag here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should probably support that... ping @diogomonica

Copy link
Contributor

Choose a reason for hiding this comment

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

Why? The resolution of what secrets go down always happens manager-side. Don't see the need for that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should it be possible to attach a group of secrets to a task or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, we need it.

Add a Secret top-level object type. Add a SecretReference that allows a
service to reference the secrets it needs.

Add dispatcher Assignments method which will replace Tasks going
forward. This provides a stream with incremental task and secret
updates. Additional object types can be supported in the assignment set
in the future. The first message returned from the Assignments stream is
the complete set of tasks and secrets for the node, and this is used to
synchronize the node's view with the manager's. Additional messages
returned by the stream are incremental updates that add, update, or
remove one or more tasks or secrets. If the agent gets out of sync with
the manager, it can reinitiate the Assignments stream to sync up.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
Signed-off-by: Diogo Monica <diogo.monica@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants