DataSourceFromInstanceWithType gets a typed data source from an instance.
(instance *store.InstanceMessage, dataSourceType storepb.DataSourceType)
| 22 | |
| 23 | // DataSourceFromInstanceWithType gets a typed data source from an instance. |
| 24 | func DataSourceFromInstanceWithType(instance *store.InstanceMessage, dataSourceType storepb.DataSourceType) *storepb.DataSource { |
| 25 | for _, dataSource := range instance.Metadata.GetDataSources() { |
| 26 | if dataSource.GetType() == dataSourceType { |
| 27 | return dataSource |
| 28 | } |
| 29 | } |
| 30 | return nil |
| 31 | } |
| 32 | |
| 33 | // FindNextPendingRole finds the next pending role in the approval flow. |
| 34 | func FindNextPendingRole(approval *storepb.IssuePayloadApproval) string { |
no test coverage detected