-
Notifications
You must be signed in to change notification settings - Fork 171
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
2515 Adding import and export #2571
Conversation
ziti/cmd/ascode/download/download.go
Outdated
} | ||
cas, err := d.GetCertificateAuthorities() | ||
if err != nil { | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean it stops at the first error? that could be .... annoying if it takes a while for this to run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it stops at errors but the command can be rerun as many times as needed because it checks if the entity exists and skip it
|
||
// convert to a map of values | ||
m := d.ToMap(item) | ||
d.Filter(m, []string{"id", "_links", "createdAt", "updatedAt"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d.Filter(m, []string{"id", "_links", "createdAt", "updatedAt"})
seems like a good candidate to refactor imo
|
||
// filter unwanted properties | ||
d.Filter(m, []string{"id", "_links", "createdAt", "updatedAt", | ||
"edgeRouterRolesDisplay", "identityRolesDisplay", "isSystem"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"isSystem" is really something we would want to filter? should any "system" entities be exported/imported at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was that anything marked as isSystem
shouldn't be included and it's filtered out because it's not a "valuable" property in that it's not settable.
m := d.ToMap(item) | ||
|
||
// filter unwanted properties | ||
d.Filter(m, []string{"id", "_links", "createdAt", "updatedAt"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAs should probably come along with a warning, indicating the user is going to need to re-verify the CA on import. it might be there, but if not, that should be added to avoid the confusion when they import and the ca is not "verified"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like a good start. let's merge it and iterate through any issues
Support in the cli to import entities into a network and exporting entities from a network. Supports both json and yaml.
closes #2515