(ctx context.Context, create *certificatedto.FileInput)
| 116 | } |
| 117 | |
| 118 | func (m *imlCertificate) Create(ctx context.Context, create *certificatedto.FileInput) error { |
| 119 | |
| 120 | return m.transaction.Transaction(ctx, func(ctx context.Context) error { |
| 121 | id := uuid.New().String() |
| 122 | version := time.Now().Format("20060102150405") |
| 123 | err := m.syncGateway(ctx, cluster.DefaultClusterID, &gateway.DynamicRelease{ |
| 124 | BasicItem: &gateway.BasicItem{ |
| 125 | ID: id, |
| 126 | Description: "", |
| 127 | Version: version, |
| 128 | MatchLabels: map[string]string{ |
| 129 | "module": "certificate", |
| 130 | }, |
| 131 | }, |
| 132 | Attr: map[string]interface{}{ |
| 133 | "key": create.Key, |
| 134 | "pem": create.Cert, |
| 135 | }, |
| 136 | }, true) |
| 137 | if err != nil { |
| 138 | return err |
| 139 | } |
| 140 | _, err = m.save(ctx, id, cluster.DefaultClusterID, create) |
| 141 | if err != nil { |
| 142 | return err |
| 143 | } |
| 144 | return nil |
| 145 | }) |
| 146 | |
| 147 | } |
| 148 | |
| 149 | func (m *imlCertificate) Update(ctx context.Context, id string, edit *certificatedto.FileInput) error { |
| 150 | old, _, err := m.service.Get(ctx, id) |
nothing calls this directly
no test coverage detected