Skip to content

Instantly share code, notes, and snippets.

View pt033302's full-sized avatar

Praveen Kumar Reddy Thangadancha pt033302

View GitHub Profile
#!/bin/sh
# Generate test coverage statistics for Go packages.
#
set -e
workdir=.cover
profile="$workdir/cover.out"
mode=count
generate_cover_data() {
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: show-non-root-steps
spec:
steps:
# no securityContext specified so will use
# securityContext from TaskRun podTemplate
- name: show-user-1001
image: ubuntu
apiVersion: v1
kind: Secret
metadata:
name: git-ssh
annotations:
tekton.dev/git-0: github.com
type: kubernetes.io/ssh-auth
data:
# Generated by:
# cat id_rsa | base64 -w 0
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: task-echo-message
spec:
params:
- name: MESSAGE1
type: string
default: "Hello World-1"
- name: MESSAGE2
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
echo "Creating secret htpass-secret ---"
oc create secret generic htpass-secret --from-file=htpasswd=$DIR/users.htpasswd -n openshift-config
echo "Creating a htpasswd identity provider"
oc apply -f $DIR/test-oauth.yaml
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** $count))
count=$(($count + 1))
if [ $count -lt $retries ]; then
@pt033302
pt033302 / fail-pipeline-with-retries.yaml
Created August 3, 2020 10:13
Disconnected pipeline run logs
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: pipeline-test
spec:
tasks:
- name: run-fail-task
retries: 1
taskRef:
name: fail-task
@pt033302
pt033302 / finally-pipeline.yaml
Created August 6, 2020 10:43
pipelines with finally tasks
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: finally-task
spec:
description: This is cluster task
steps:
- image: python
name: step-one
script: |
@pt033302
pt033302 / Observation.md
Last active August 10, 2020 11:26
read-two task stays in pending for ever
  • Taskrun read-two-at-a-time-* stays pending forever
  • pod events says Multi-Attach error for volume "pvc-516ab87d-a700-4381-a240-2af07f802a1c" Volume is already used by pod(s) affinity-assistant-e897f506c0-0
  • affinity assitance pods goes to crashbackloops
  • Work around
oc edit cm feature-flags -n openshift-pipelines
change disable-affinity-assistant="true"
# Copyright 2019 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,