Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions .tekton/assets/sidecars.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"name": "zookeeper",
"image": "confluentinc/cp-zookeeper:7.9.1",
"image": " public.ecr.aws/aktosecurity/confluentinc-cp-zookeeper:7.9.2-1-ubi8",
"env": [{ "name": "ZOOKEEPER_CLIENT_PORT", "value": "2181" }],
"readinessProbe": {
"tcpSocket": {
Expand All @@ -42,32 +42,9 @@
"timeoutSeconds": 30
}
},
{
"name": "schema-registry",
"image": "confluentinc/cp-schema-registry:7.9.0",
"env": [
{ "name": "SCHEMA_REGISTRY_HOST_NAME", "value": "schema-registry" },
{ "name": "SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL", "value": "0.0.0.0:2181" },
{ "name": "SCHEMA_REGISTRY_LISTENERS", "value": "http://0.0.0.0:8081" },
{
"name": "SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS",
"value": "PLAINTEXT://0.0.0.0:29092"
},
{ "name": "SCHEMA_REGISTRY_DEBUG", "value": "true" }
],
"readinessProbe": {
"httpGet": {
"path": "/",
"port": 8081
},
"initialDelaySeconds": 5,
"periodSeconds": 2,
"timeoutSeconds": 60
}
},
{
"name": "kafka",
"image": "confluentinc/cp-kafka:7.9.1",
"image": "public.ecr.aws/aktosecurity/confluentinc-cp-kafka:7.9.1-1-ubi8",
"env": [
{ "name": "KAFKA_BROKER_ID", "value": "1" },
{ "name": "KAFKA_ZOOKEEPER_CONNECT", "value": "localhost:2181" },
Expand Down Expand Up @@ -97,7 +74,7 @@
},
{
"name": "kafka-topics",
"image": "confluentinc/cp-kafka:7.9.1",
"image": "public.ecr.aws/aktosecurity/confluentinc-cp-kafka:7.9.1-1-ubi8",
"command": ["/bin/bash"],
"args": [
"-lc",
Expand Down
23 changes: 13 additions & 10 deletions .tekton/generate-test-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = require('path');

const sidecarGroups = {
redis: ['redis', 'redis-slave', 'redis-sentinel'],
kafka: ['zookeeper', 'kafka', 'kafka-topics', 'schema-registry'],
kafka: ['zookeeper', 'kafka', 'kafka-topics'],
nats: ['nats', 'nats-streaming', 'nats-streaming-2']
};

Expand Down Expand Up @@ -213,7 +213,10 @@ function renderSidecar(sidecarName) {
function generateTask(taskName, sidecars, options = {}) {
const templateContent = fs.readFileSync(path.join(__dirname, 'templates/test-task.yaml.template'), 'utf-8');

const sidecarYaml = sidecars.map(s => renderSidecar(s)).filter(Boolean).join('\n');
const sidecarYaml = sidecars
.map(s => renderSidecar(s))
.filter(Boolean)
.join('\n');
const availableSidecars = sidecars.join(',');
const claimTests = options.scope === '@instana/collector' ? 'true' : 'false';
const totalTasks = options.split || '1';
Expand Down Expand Up @@ -318,11 +321,7 @@ function updatePipelineCollectorEntries(tasks) {
);
}

const result = [
...lines.slice(0, firstCollectorLine),
...newEntries,
...lines.slice(afterLastCollectorLine)
];
const result = [...lines.slice(0, firstCollectorLine), ...newEntries, ...lines.slice(afterLastCollectorLine)];

fs.writeFileSync(pipelinePath, result.join('\n'));
console.log(`Updated pipeline with ${tasks.length} collector task entries`);
Expand Down Expand Up @@ -352,7 +351,9 @@ for (const [groupName, config] of Object.entries(packages)) {
sidecarCounts[s] = (sidecarCounts[s] || 0) + 1;
});
});
const sidecarCountsStr = Object.entries(sidecarCounts).map(([k, v]) => `${k}=${v}`).join(',');
const sidecarCountsStr = Object.entries(sidecarCounts)
.map(([k, v]) => `${k}=${v}`)
.join(',');

const collectorTasks_ = [];

Expand Down Expand Up @@ -380,7 +381,10 @@ for (const [groupName, config] of Object.entries(packages)) {
const runs = config.split ? Array.from({ length: config.split }, (_, i) => i + 1) : [1];

for (const number of runs) {
let sanitizedGroupName = groupName.replace(/:/g, '-').replace(/^test-/, '').replace(/^ci-/, '');
let sanitizedGroupName = groupName
.replace(/:/g, '-')
.replace(/^test-/, '')
.replace(/^ci-/, '');

if (number > 1) {
sanitizedGroupName = `${sanitizedGroupName}-split-${number}`;
Expand All @@ -401,4 +405,3 @@ for (const [groupName, config] of Object.entries(packages)) {
}

console.log('\nDone!');

Loading