Skip to content

Commit

Permalink
Package Updates + Protect against downgrade of packages (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudpossebot committed Aug 23, 2020
1 parent ce0970d commit a985a1f
Show file tree
Hide file tree
Showing 31 changed files with 157 additions and 72 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN apk add --update --no-cache bash make curl coreutils libc6-compat tar xz jq

COPY --from=cfssl /go/bin/ ${INSTALL_PATH}/

COPY bin/ /usr/local/bin/

COPY . /packages
RUN mkdir -p /packages/tmp
RUN make -C /packages/install/ all
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,19 @@ exit
amtool 0.21.0 Tool for interacting with the Alertmanager API
argocd 1.6.2 Declarative GitOpts for Kubernetes
assume-role 0.3.2 Easily assume AWS roles in your terminal.
atlantis 0.14.0 Terraform For Teams
atlantis 0.15.0 Terraform For Teams
awless 0.1.11 A Mighty CLI for AWS
aws-iam-authenticator 0.5.1 A tool to use AWS IAM credentials to authenticate to a Kubernetes cluster
aws-okta 0.19.4 aws-okta allows users to authenticate with AWS using Okta credentials
aws-vault 4.7.2 A vault for securely storing and accessing AWS credentials in development environments
aws-vault 5.4.4 A vault for securely storing and accessing AWS credentials in development environments
cfssl 1.4.1 Cloudflare's PKI and TLS toolkit
cfssljson 1.4.1 Cloudflare's PKI and TLS toolkit json parser
chamber 2.8.2 CLI for managing secrets
cli53 0.8.17 Command line tool for Amazon Route 53
cloudflared 2020.3.2 Argo Tunnel client
cloudposse-atlantis 0.9.0.3 Terraform For Teams, enhanced by Cloud Posse
codefresh 0.71.8 Codefresh CLI
consul 1.8.1 Hashicorp consul
codefresh 0.72.1 Codefresh CLI
consul 1.8.3 Hashicorp consul
ctop 0.7.3 Top-like interface for container metrics
direnv 2.21.3 Unclutter your .profile
doctl 1.46.0 A command line tool for DigitalOcean services
Expand All @@ -266,27 +266,27 @@ gonsul 0.2.1 A stand-alone alternative to git2consul
goofys 0.24.0 a high-performance, POSIX-ish Amazon S3 file system written in Go
gosu 1.12 Simple Go-based setuid+setgid+setgroups+exec
gotop 3.0.0 A terminal based graphical activity monitor inspired by gtop and vtop
helm 3.2.4 The Kubernetes Package Manager
helm2 2.16.9 The Kubernetes Package Manager
helm3 3.2.4 The Kubernetes Package Manager
helmfile 0.124.0 Deploy Kubernetes Helm Charts
htmltest 0.12.1 :white_check_mark: Test generated HTML for problems
helm 3.3.0 The Kubernetes Package Manager
helm2 2.16.10 The Kubernetes Package Manager
helm3 3.3.0 The Kubernetes Package Manager
helmfile 0.125.7 Deploy Kubernetes Helm Charts
htmltest 0.13.0 :white_check_mark: Test generated HTML for problems
hugo 0.74.3 The world’s fastest framework for building websites.
jp 0.1.3 Command line interface to JMESPath
jq 1.6 Command-line JSON processor
json2hcl 0.0.6 Convert JSON to HCL, and vice versa
jx 2.1.121 Jenkins-X
k3d 3.0.0 Little helper to run Rancher Lab's k3s in Docker
jx 2.1.127 Jenkins-X
k3d 3.0.1 Little helper to run Rancher Lab's k3s in Docker
k6 0.27.1 A modern load testing tool, using Go and JavaScript - https://k6.io
k9s 0.21.7 Kubernetes CLI To Manage Your Clusters In Style
katafygio 0.8.1 K8s continuous backup to git
kfctl 1.0 Machine Learning Toolkit for Kubernetes
kind 0.8.1 A tool for running local Kubernetes clusters using Docker
kops 1.17.1 Kubernetes Operations (kops) - Production Grade K8s Installation, Upgrades, and Management
kops 1.18.0 Kubernetes Operations (kops) - Production Grade K8s Installation, Upgrades, and Management
kops-1.12 1.12.3 Kubernetes Operations (kops) - Production Grade K8s Installation, Upgrades, and Management
krew 0.3.4 Kubectl plugin manager
kubecron 1.0.2 Utilities to manage kubernetes cronjobs. Run a CronJob manually for test purposes. Suspend/unsuspend a CronJob
kubectl 1.18.6 Production-Grade Container Scheduling and Management
kubectl 1.18.8 Production-Grade Container Scheduling and Management
kubectl-1.13 1.13.12 Production-Grade Container Scheduling and Management (v1.13)
kubectl-1.14 1.14.10 Production-Grade Container Scheduling and Management (v1.14)
kubectl-1.15 1.15.12 Production-Grade Container Scheduling and Management (v1.15)
Expand All @@ -296,20 +296,20 @@ kubectx 0.9.1 Switch faster between clusters and namespac
kubens 0.9.1 Switch faster between clusters and namespaces in kubectl
kubeval 0.15.0 Validate your Kubernetes configuration files, supports multiple Kubernetes versions
lazydocker 0.9 The lazier way to manage everything docker
lectl 0.20 Script to check issued certificates by Let's Encrypt on CTL (Certificate Transparency Log) using https://crt.sh
minikube 1.12.1 Run Kubernetes locally
lectl 0.21 Script to check issued certificates by Let's Encrypt on CTL (Certificate Transparency Log) using https://crt.sh
minikube 1.12.3 Run Kubernetes locally
misspell 0.3.4 Correct commonly misspelled English words in source files
nomad 0.12.1 Hashicorp nomad
pack 0.12.0 Create cloud native Buildpacks
nomad 0.12.3 Hashicorp nomad
pack 0.13.1 Create cloud native Buildpacks
packer 1.6.1 Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
pandoc 2.10.1 Universal markup converter
pgmetrics 1.9.3 Postgres metrics
pluto 3.4.0 A cli tool to help discover deprecated apiVersions in Kubernetes
pluto 3.4.1 A cli tool to help discover deprecated apiVersions in Kubernetes
popeye 0.8.8 A Kubernetes cluster resource sanitizer
promtool 2.19.3 Prometheus CLI tool
rakkess 0.4.4 Review Access - kubectl plugin to show an access matrix for all available resources
promtool 2.20.1 Prometheus CLI tool
rakkess 0.4.5 Review Access - kubectl plugin to show an access matrix for all available resources
rancher 2.4.5 Rancher CLI
rbac-lookup 0.6.0 Find Kubernetes roles and cluster roles bound to any user, service account, or group name.
rbac-lookup 0.6.1 Find Kubernetes roles and cluster roles bound to any user, service account, or group name.
retry 3.3.0 ♻️ Functional mechanism based on channels to perform actions repetitively until successful.
saml2aws 2.26.2 CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP
scenery 0.1.5 A Terraform plan output prettifier
Expand All @@ -333,9 +333,9 @@ terraform_0.13 0.13.0 Terraform (Deprecated package. Use terrafor
terragrunt 0.23.33 Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
terrahelp 0.7.4 Terrahelp is as a command line utility that provides useful tricks like masking of terraform output.
tfenv 0.4.0 Transform environment variables for use with Terraform (e.g. `HOSTNAME` ⇨ `TF_VAR_hostname`)
tfmask 0.6.1 Terraform utility to mask select output from `terraform plan` and `terraform apply`
tfmask 0.7.0 Terraform utility to mask select output from `terraform plan` and `terraform apply`
thanos 0.14.0 Highly available Prometheus setup with long term storage capabilities. CNCF Sandbox project.
trivy 0.10.1 A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
trivy 0.10.2 A Simple and Comprehensive Vulnerability Scanner for Containers, Suitable for CI
variant 0.36.5 Variant is a Universal CLI tool that works like a task runner
variant2 0.33.0 Second major version of Variant, a Universal CLI tool that works like a task runner
vault 1.5.0 Hashicorp vault
Expand Down
74 changes: 74 additions & 0 deletions bin/semver
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

###
# semantic version comparition using semver specification http://semver.org/
# This bash script compares pre-releases alphabetically as well
#
# Copied from https://gist.githubusercontent.com/Ariel-Rodriguez/9e3c2163f4644d7a389759b224bfe7f3/raw/816453441da56058b73af5812db6217fb71897d2/semver.sh
#
#
# returns 1 when A greater than B
# returns 0 when A equals B
# returns -1 when A lower than B
#
# Usage
# chmod +x semver.sh
# ./semver.sh 1.0.0 v1.0.0-rc.0
# --> 1
#
# Author Ariel Rodriguez
# License MIT
###
semver_compare() {
local version_a version_b pr_a pr_b
# strip word "v" and extract first subset version (x.y.z from x.y.z-foo.n)
version_a=$(echo "${1//v/}" | awk -F'-' '{print $1}')
version_b=$(echo "${2//v/}" | awk -F'-' '{print $1}')

if [ "$version_a" \= "$version_b" ]
then
# check for pre-release
# extract pre-release (-foo.n from x.y.z-foo.n)
pr_a=$(echo "$1" | awk -F'-' '{print $2}')
pr_b=$(echo "$2" | awk -F'-' '{print $2}')

####
# Return 0 when A is equal to B
[ "$pr_a" \= "$pr_b" ] && echo 0 && return 0

####
# Return 1

# Case when A is not pre-release
if [ -z "$pr_a" ]
then
echo 1 && return 0
fi

####
# Case when pre-release A exists and is greater than B's pre-release

# extract numbers -rc.x --> x
number_a=$(echo ${pr_a//[!0-9]/})
number_b=$(echo ${pr_b//[!0-9]/})
[ -z "${number_a}" ] && number_a=0
[ -z "${number_b}" ] && number_b=0

[ "$pr_a" \> "$pr_b" ] && [ -n "$pr_b" ] && [ "$number_a" -gt "$number_b" ] && echo 1 && return 0

####
# Retrun -1 when A is lower than B
echo -1 && return 0
fi
arr_version_a=(${version_a//./ })
arr_version_b=(${version_b//./ })
cursor=0
# Iterate arrays from left to right and find the first difference
while [ "$([ "${arr_version_a[$cursor]}" -eq "${arr_version_b[$cursor]}" ] && [ $cursor -lt ${#arr_version_a[@]} ] && echo true)" == true ]
do
cursor=$((cursor+1))
done
[ "${arr_version_a[$cursor]}" -gt "${arr_version_b[$cursor]}" ] && echo 1 || echo -1
}

[ -n "$1" ] && echo $(semver_compare $1 $2)
Loading

0 comments on commit a985a1f

Please sign in to comment.