Skip to content

Instantly share code, notes, and snippets.

View pt033302's full-sized avatar

Praveen Kumar Reddy Thangadancha pt033302

View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
BREW_IIB_PREFIX="brew.registry.redhat.io/rh-osbs/iib"
REGISTRY=${REGISTRY:-"brew.registry.redhat.io"}
ENVSTAGE="stage"
if [[ ${ENVIRONMENT} = ${ENVSTAGE} ]]; then
#!/usr/bin/env bash
set -euo pipefail
MIRROR_REG=${MIRROR_REG:-}
PRODUCT_NAME=${PRODUCT_NAME:-pipeline}
INDEX=${INDEX:-}
BREW_IIB_PREFIX="brew.registry.redhat.io/rh-osbs/iib"
REGISTRY_IMAGE=$BREW_IIB_PREFIX:$INDEX
OUTPUT_IMAGE=$MIRROR_REG/rh-osbs/iib:$INDEX
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
if [ -f $DIR/users.htpasswd ]; then
echo -e "users.htpasswd already exists."
else
echo -e "Downloading users.htpasswd..."
curl -s https://gist.githubusercontent.com/praveen4g0/b42f98246e05282e3595ff6572adb658/raw/4ab72c9259abfbebb5347c7325a210c45fc16120/users.htpasswd > $DIR/users.htpasswd
echo -e "Done!"
@pt033302
pt033302 / catalog-source.yaml
Created September 7, 2020 12:20
workaround for installing 4.5 operators on 4.6 cluster
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: praveen-operators
namespace: openshift-marketplace
spec:
sourceType: grpc
image: quay.io/praveen4g0/redhat-operators:v1
displayName: praveen-operator-sources
sourceType: grpc
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
generateName: pipeline-template-git-pr-
spec:
params:
- name: git-repo-url
- name: pullreq-sha
- name: pullreq-action
- name: pullreq-number
# 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,
@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"
@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 / 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
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** $count))
count=$(($count + 1))
if [ $count -lt $retries ]; then