forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read from tekton hub config to enable/disable the hub tasks in pipeli…
…ne builder
- Loading branch information
1 parent
b1a553e
commit 3cd71c7
Showing
7 changed files
with
238 additions
and
3 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
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
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
1 change: 1 addition & 0 deletions
1
frontend/packages/pipelines-plugin/src/components/catalog/const.ts
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const TEKTON_HUB_API_ENDPOINT = 'https://api.hub.tekton.dev'; | ||
export const TEKTON_HUB_ENDPOINT = `https://hub.tekton.dev`; | ||
export const TEKTON_HUB_INTEGRATION_KEY = 'enable-devconsole-integration'; |
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
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
130 changes: 130 additions & 0 deletions
130
frontend/packages/pipelines-plugin/src/test-data/tekon-config-data.ts
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,130 @@ | ||
import { K8sResourceKind } from 'public/module/k8s'; | ||
import { TEKTON_HUB_INTEGRATION_KEY } from '../components/catalog/const'; | ||
|
||
export enum IntegrationTypes { | ||
ENABLED = 'enabled', | ||
DISABLED = 'disabled', | ||
MISSING_INTEGRATION_KEY = 'missing-integration-key', | ||
} | ||
|
||
type TekonHubIntegrationConfigs = { [key in IntegrationTypes]?: K8sResourceKind }; | ||
|
||
const sampleTektonConfig = { | ||
apiVersion: 'operator.tekton.dev/v1alpha1', | ||
kind: 'TektonConfig', | ||
metadata: { | ||
creationTimestamp: '2022-01-04T05:13:42Z', | ||
finalizers: ['tektonconfigs.operator.tekton.dev'], | ||
name: 'config', | ||
resourceVersion: '97919', | ||
uid: '3f5045e0-44b5-4a50-8ba8-1e55e9f953d0', | ||
}, | ||
spec: { | ||
addon: { | ||
params: [ | ||
{ | ||
name: 'clusterTasks', | ||
value: 'true', | ||
}, | ||
{ | ||
name: 'pipelineTemplates', | ||
value: 'true', | ||
}, | ||
], | ||
}, | ||
pipeline: { | ||
'running-in-environment-with-injected-sidecars': true, | ||
'metrics.taskrun.duration-type': 'histogram', | ||
'disable-home-env-overwrite': true, | ||
'metrics.pipelinerun.duration-type': 'histogram', | ||
params: [ | ||
{ | ||
name: 'enableMetrics', | ||
value: 'true', | ||
}, | ||
], | ||
'default-service-account': 'pipeline', | ||
'disable-working-directory-overwrite': true, | ||
'scope-when-expressions-to-task': false, | ||
'require-git-ssh-secret-known-hosts': false, | ||
'enable-tekton-oci-bundles': false, | ||
'metrics.taskrun.level': 'task', | ||
'metrics.pipelinerun.level': 'pipeline', | ||
'enable-api-fields': 'stable', | ||
'enable-custom-tasks': false, | ||
'disable-creds-init': false, | ||
'disable-affinity-assistant': true, | ||
}, | ||
config: {}, | ||
params: [ | ||
{ | ||
name: 'createRbacResource', | ||
value: 'true', | ||
}, | ||
], | ||
pruner: { | ||
keep: 100, | ||
resources: ['pipelinerun'], | ||
schedule: '0 8 * * *', | ||
}, | ||
profile: 'all', | ||
targetNamespace: 'openshift-pipelines', | ||
dashboard: { | ||
readonly: false, | ||
}, | ||
trigger: { | ||
'default-service-account': 'pipeline', | ||
'enable-api-fields': 'stable', | ||
}, | ||
}, | ||
status: { | ||
conditions: [ | ||
{ | ||
lastTransitionTime: '2022-01-04T05:15:04Z', | ||
status: 'True', | ||
type: 'ComponentsReady', | ||
}, | ||
{ | ||
lastTransitionTime: '2022-01-04T05:15:54Z', | ||
status: 'True', | ||
type: 'PostInstall', | ||
}, | ||
{ | ||
lastTransitionTime: '2022-01-04T05:13:54Z', | ||
status: 'True', | ||
type: 'PreInstall', | ||
}, | ||
{ | ||
lastTransitionTime: '2022-01-04T05:15:54Z', | ||
status: 'True', | ||
type: 'Ready', | ||
}, | ||
], | ||
tektonInstallerSets: { | ||
'rhosp-rbac': 'rbac-resources', | ||
}, | ||
version: 'v1.6.1', | ||
}, | ||
}; | ||
|
||
export const tektonHubIntegrationConfigs: TekonHubIntegrationConfigs = { | ||
[IntegrationTypes.MISSING_INTEGRATION_KEY]: sampleTektonConfig, | ||
[IntegrationTypes.ENABLED]: { | ||
...sampleTektonConfig, | ||
spec: { | ||
...sampleTektonConfig.spec, | ||
hub: { | ||
params: [{ name: TEKTON_HUB_INTEGRATION_KEY, value: true }], | ||
}, | ||
}, | ||
}, | ||
[IntegrationTypes.DISABLED]: { | ||
...sampleTektonConfig, | ||
spec: { | ||
...sampleTektonConfig.spec, | ||
hub: { | ||
params: [{ name: TEKTON_HUB_INTEGRATION_KEY, value: false }], | ||
}, | ||
}, | ||
}, | ||
}; |