Skip to content

Commit

Permalink
image.get: No longer pass base options
Browse files Browse the repository at this point in the history
Change-type: major
  • Loading branch information
myarmolinsky committed Jan 15, 2025
1 parent c06e72a commit 82dee7f
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/models/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.

import * as errors from 'balena-errors';
import type { Image, PineOptions, InjectedDependenciesParam } from '..';
import { mergePineOptions } from '../util';

const getImageModel = function (deps: InjectedDependenciesParam) {
const { pine } = deps;
Expand All @@ -39,33 +38,10 @@ const getImageModel = function (deps: InjectedDependenciesParam) {
* });
*/
async get(id: number, options: PineOptions<Image> = {}): Promise<Image> {
const baseOptions = {
$select: [
// Select all the interesting fields *except* build_log
// (which can be very large)
'id',
'content_hash',
'dockerfile',
'project_type',
'status',
'error_message',
'image_size',
'created_at',
'push_timestamp',
'start_timestamp',
'end_timestamp',
],
} satisfies PineOptions<Image>;
const image = await pine.get({
resource: 'image',
id,
options: mergePineOptions(
baseOptions,
options,
// TODO: Mark the build_log as explicitRead in the next API model version
// so that we can remove this & the explicit property selection from here.
true,
),
options,
});
if (image == null) {
throw new errors.BalenaImageNotFound(id);
Expand Down

0 comments on commit 82dee7f

Please sign in to comment.