Skip to content

Commit

Permalink
fix: pr 68 merge and added interfaces
Browse files Browse the repository at this point in the history
Signed-off-by: mbwhite <[email protected]>
  • Loading branch information
mbwhite committed Jan 8, 2024
1 parent cd15fc5 commit 22beab6
Show file tree
Hide file tree
Showing 39 changed files with 350 additions and 319 deletions.
13 changes: 0 additions & 13 deletions interfaces/event-listener/index.ts

This file was deleted.

10 changes: 0 additions & 10 deletions interfaces/pipeline/condition.ts

This file was deleted.

17 changes: 0 additions & 17 deletions interfaces/pipeline/index.ts

This file was deleted.

20 changes: 0 additions & 20 deletions interfaces/pipeline/resources.ts

This file was deleted.

28 changes: 0 additions & 28 deletions interfaces/pipeline/task.ts

This file was deleted.

10 changes: 0 additions & 10 deletions interfaces/task/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions interfaces/task/resources.ts

This file was deleted.

8 changes: 0 additions & 8 deletions interfaces/task/sidecar.ts

This file was deleted.

26 changes: 0 additions & 26 deletions interfaces/task/step.ts

This file was deleted.

21 changes: 0 additions & 21 deletions interfaces/task/task-spec.ts

This file was deleted.

7 changes: 0 additions & 7 deletions interfaces/task/workspace.ts

This file was deleted.

10 changes: 0 additions & 10 deletions interfaces/trigger-binding/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions interfaces/trigger-template/index.ts

This file was deleted.

57 changes: 0 additions & 57 deletions interfaces/trigger-template/resource-template.ts

This file was deleted.

9 changes: 0 additions & 9 deletions interfaces/trigger-template/workspace.ts

This file was deleted.

20 changes: 20 additions & 0 deletions no-duplicate-env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: no-duplicate-env-3
spec:
stepTemplate:
env:
- name: FOO
value: foo
steps:
- name: step-1
image: alpine
env:
- name: FOO
value: foo
script: |
#!/bin/sh
echo ${FOO}
2 changes: 1 addition & 1 deletion regression-tests/general/no-duplicate-env.yaml.expect.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"message":"Step 'step-2' has env variable 'FOO' duplicated in task 'no-duplicate-env-1'.","rule":"no-duplicate-env","level":"error","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[393,396,397],"startLine":25,"startColumn":17,"endLine":25,"endColumn":20}},{"message":"StepTemplate has env variable 'FOO' duplicated in task 'no-duplicate-env-2'.","rule":"no-duplicate-env","level":"error","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[733,736,737],"startLine":48,"startColumn":15,"endLine":48,"endColumn":18}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[130,136,137],"startLine":9,"startColumn":14,"endLine":9,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[318,324,325],"startLine":21,"startColumn":14,"endLine":21,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[506,512,513],"startLine":33,"startColumn":14,"endLine":33,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[797,803,804],"startLine":52,"startColumn":14,"endLine":52,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[1051,1057,1058],"startLine":69,"startColumn":14,"endLine":69,"endColumn":20}}]
[{"message":"Step 'step-2' has env variable 'FOO' duplicated in task 'no-duplicate-env-1'.","rule":"no-duplicate-env","level":"error","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[393,396,397],"startLine":25,"startColumn":17,"endLine":25,"endColumn":20}},{"message":"StepTemplate has env variable 'FOO' duplicated in task 'no-duplicate-env-2'.","rule":"no-duplicate-env","level":"error","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[733,736,737],"startLine":48,"startColumn":15,"endLine":48,"endColumn":18}},{"message":"StepTemplate in task 'no-duplicate-env-3' and Step 'step-1' define the same env variable.","rule":"no-duplicate-env","level":"error","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[1085,1088,1089],"startLine":71,"startColumn":17,"endLine":71,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[130,136,137],"startLine":9,"startColumn":14,"endLine":9,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[318,324,325],"startLine":21,"startColumn":14,"endLine":21,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[506,512,513],"startLine":33,"startColumn":14,"endLine":33,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[797,803,804],"startLine":52,"startColumn":14,"endLine":52,"endColumn":20}},{"message":"Invalid image: 'alpine'. Specify the image tag instead of using ':latest'","rule":"no-latest-image","level":"warning","path":"./regression-tests/general/no-duplicate-env.yaml","loc":{"range":[1051,1057,1058],"startLine":69,"startColumn":14,"endLine":69,"endColumn":20}}]
16 changes: 8 additions & 8 deletions src/interfaces/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ValueParam {
value: string;
}

type listResources = {
type ListResources = {
[key: string]: Base;
};

Expand All @@ -35,12 +35,12 @@ interface ExternalResource {
}

interface Tekton {
tasks?: listResources;
pipelines?: listResources;
listeners?: listResources;
triggerTemplates?: listResources;
triggerBindings?: listResources;
conditions?: listResources;
tasks?: { [key: string]: Base };
pipelines?: ListResources;
listeners?: ListResources;
triggerTemplates?: ListResources;
triggerBindings?: ListResources;
conditions?: ListResources;
externaltasks?: ExternalResource[];
}

Expand Down Expand Up @@ -83,4 +83,4 @@ export type Problem = {
loc: Location;
};

export { Tekton, Base, Param, BaseName, ValueParam, ExternalResource };
export { Tekton, Base, Param, BaseName, ValueParam, ExternalResource, ListResources };
13 changes: 13 additions & 0 deletions src/interfaces/event-listener/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Trigger from './trigger.js';

import { Base } from '../common.js';

interface EventListener extends Base {
kind: 'EventListener';
spec: {
triggers: Trigger[];
};
serviceType?: string;
}

export default EventListener;
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { BaseName } from '../common';
import { BaseName } from '../common.js';

interface BaseTrigger {
name? : string;
template: BaseName;
name?: string;
template: BaseName;
}

interface BindingTrigger extends BaseTrigger {
binding: BaseName;
binding: BaseName;
}

interface BindingsTrigger extends BaseTrigger {
bindings: {
name?: string;
ref?: string;
}[];
bindings: {
name?: string;
ref?: string;
}[];
}

type Trigger = BindingTrigger | BindingsTrigger;
Expand Down
10 changes: 10 additions & 0 deletions src/interfaces/pipeline/condition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { TaskResource } from './resources.js';
import { Base, ValueParam } from '../common.js';

interface Condition extends Base {
conditionRef: string;
params?: ValueParam[];
resources?: TaskResource[];
}

export default Condition;
Loading

0 comments on commit 22beab6

Please sign in to comment.