Skip to content

Commit

Permalink
refactor: move target outside of config + remove fleet group and targ…
Browse files Browse the repository at this point in the history
…et id in favor for data
  • Loading branch information
Looskie committed Jan 2, 2024
1 parent c7cf2df commit bce927a
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/rest/types/ignite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
Timestamp,
} from '../../util/types.ts';
import type {Endpoint} from '../endpoints.ts';
import type {TargetID} from './fleet.ts';
import type {Node} from './fleet.ts';

/**
* All regions that Hop operates in
Expand Down Expand Up @@ -238,7 +238,7 @@ export interface Deployment {
/**
* The config for this deployment
*/
config: Omit<DeploymentConfig, 'name'>;
config: Omit<DeploymentConfig, 'name' | 'target'>;

/**
* Current active rollout for deployment
Expand Down Expand Up @@ -291,6 +291,11 @@ export interface Deployment {
* The group the deployment belongs in
*/
group_id: Id<'deployment_group'> | null;

/**
* Target node for deployment, if its undefined its inferred as Hop
*/
target?: DeploymentTarget | undefined;
}

/**
Expand Down Expand Up @@ -682,11 +687,6 @@ export interface DeploymentConfig {
*/
type: RuntimeType;

/**
* Target node for deployment, if its undefined its inferred as Hop
*/
target?: DeploymentTarget | undefined;

/**
* The version of this config
*/
Expand Down Expand Up @@ -728,6 +728,11 @@ export interface DeploymentConfig {
* Entrypoint for this deployment
*/
entrypoint?: string[];

/**
* Target node for deployment, if its undefined its inferred as Hop
*/
target?: DeploymentTarget | undefined;
}

/**
Expand All @@ -754,13 +759,13 @@ export interface Image {

export interface DeploymentTarget {
/**
* The type of target (Hop, Fleet Node or Fleet Group)
* The type of target (Hop, Fleet Node) (fleet group coming later)
*/
type: 'hop' | 'fleet_node' | 'fleet_group';
type: 'hop' | 'fleet_node';
/**
* The ID of the target that the deployment will be deployed to
* The data of the target
*/
target_id: TargetID;
data: Node | null;
}

/**
Expand Down

0 comments on commit bce927a

Please sign in to comment.