-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #547 from kubeshop/feat/dry-run-config-types
Feat/dry run config types
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@monokle/types": minor | ||
--- | ||
|
||
add dry-run config types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
export type DryRunConfigKind = 'kustomize' | 'helm'; | ||
|
||
type Args = Array<Array<[string]>>; | ||
|
||
interface BaseConfig { | ||
workdir?: string; | ||
kind: DryRunConfigKind; | ||
version?: string; | ||
command?: string; | ||
} | ||
|
||
interface HelmConfig extends BaseConfig { | ||
kind: 'helm'; | ||
command?: 'template'; | ||
values?: string[]; | ||
output?: string; | ||
set?: { | ||
[k: string]: unknown; | ||
}; | ||
args?: Args; | ||
} | ||
|
||
interface KustomizeConfig extends BaseConfig { | ||
kind: 'kustomize'; | ||
command?: 'build'; | ||
env?: { | ||
[k: string]: unknown; | ||
}; | ||
enableHelm?: boolean; | ||
output?: string; | ||
reorder?: 'legacy' | 'none'; | ||
args?: Args; | ||
} | ||
|
||
export interface DryRunHelmConfig extends HelmConfig { | ||
postRender?: Array<HelmConfig | Omit<DryRunKustomizeConfig, 'postRender'>> | ||
} | ||
|
||
export interface DryRunKustomizeConfig extends KustomizeConfig { | ||
postRender?: Array<Omit<DryRunHelmConfig, 'postRender'> | Omit<DryRunKustomizeConfig, 'postRender'>> | ||
} | ||
|
||
export type DryRunConfig = DryRunKustomizeConfig | DryRunHelmConfig; | ||
|
||
export interface DryRunConfigObject< | ||
T extends DryRunConfig = DryRunConfig | ||
> { | ||
[key: string]: unknown; | ||
apiVersion: string; | ||
kind: 'DryRun'; | ||
metadata: { | ||
name: string; | ||
[k: string]: unknown; | ||
}; | ||
include?: string[]; // regex of involved files, when changed it automatically re-renders | ||
data: T; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters