Skip to content

Commit

Permalink
chore(scheduler): sync the chaos-scheduler with latest chaosengine (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io>
  • Loading branch information
ispeakc0de committed Jun 13, 2024
1 parent c8fb9b0 commit 69c7633
Show file tree
Hide file tree
Showing 9 changed files with 2,258 additions and 152 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.20.0

# Checkout to the latest commit
# On specific directory/path
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Build an image from Dockerfile
run: |
docker build -f build/Dockerfile -t docker.io/litmuschaos/chaos-scheduler:${{ github.sha }} . --build-arg TARGETPLATFORM=linux/amd64
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
Expand All @@ -44,7 +44,7 @@ jobs:
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
severity: 'CRITICAL,HIGH'

image-build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.20.0

# Checkout to the latest commit
# On specific directory/path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
# Install golang
- uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.20.0

# Checkout to the latest commit
# On specific directory/path
Expand Down
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Multi-stage docker build
# Build stage
FROM golang:1.16 AS builder
FROM golang:1.20 AS builder

LABEL maintainer="LitmusChaos"

Expand All @@ -23,7 +23,7 @@ FROM litmuschaos/infra-alpine

LABEL maintainer="LitmusChaos"

ENV SCHEDULER=/usr/local/bin/chaos-scheduler
ENV SCHEDULER=/usr/local/bin/chaos-scheduler
COPY --from=builder /output/chaos-scheduler ${SCHEDULER}

ENTRYPOINT ["/usr/local/bin/chaos-scheduler"]
6 changes: 2 additions & 4 deletions deploy/crds/chaosschedule_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
startTime: "2020-05-12T05:47:00Z" #should be modified according to current UTC Time, for type=repeat
endTime: "2020-09-13T02:58:00Z" #should be modified according to current UTC Time, for type=repeat
properties:
minChaosInterval:
minChaosInterval:
minute:
everyNthMinute: 2
workHours:
Expand All @@ -21,13 +21,11 @@ spec:
appns: 'default'
applabel: 'app=nginx'
appkind: 'deployment'
# It can be true/false
annotationCheck: 'false'
# It can be active/stop
engineState: 'active'
#ex. values: ns1:name=percona,ns2:run=nginx
auxiliaryAppInfo: ''
chaosServiceAccount: pod-delete-sa
chaosServiceAccount: litmus-admin
# It can be delete/retain
jobCleanUpPolicy: 'delete'
experiments:
Expand Down
2,257 changes: 2,157 additions & 100 deletions deploy/crds/chaosschedule_crd.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions deploy/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: scheduler
---
# Source: openebs/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: scheduler
Expand All @@ -24,7 +24,7 @@ rules:
resources: ["chaosengines","chaosschedules"]
verbs: ["get","create","update","patch","delete","list","watch","deletecollection"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: scheduler
Expand Down
77 changes: 71 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,78 @@
module github.com/litmuschaos/chaos-scheduler

go 1.16
go 1.20

require (
github.com/go-logr/logr v0.4.0
github.com/litmuschaos/chaos-operator v0.0.0-20220714075136-66fee1fb7ef7
github.com/go-logr/logr v1.2.3
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7
github.com/litmuschaos/litmus-go v0.0.0-20210705063441-babf0c4aa57d
github.com/operator-framework/operator-sdk v0.15.2
github.com/operator-framework/operator-sdk v0.19.0
github.com/robfig/cron/v3 v3.0.1
k8s.io/api v0.22.2
k8s.io/apimachinery v0.22.2
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/client-go v12.0.0+incompatible
sigs.k8s.io/controller-runtime v0.10.0
)

require (
cloud.google.com/go v0.81.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logr/zapr v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.22.1 // indirect
k8s.io/component-base v0.22.2 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect
k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

// Pinned to kubernetes-1.21.2
replace (
k8s.io/api => k8s.io/api v0.21.2
Expand All @@ -39,6 +98,12 @@ replace (
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.2
)

replace (
github.com/go-logr/logr => github.com/go-logr/logr v0.4.0
github.com/operator-framework/operator-sdk => github.com/operator-framework/operator-sdk v0.15.2
k8s.io/klog/v2 => k8s.io/klog/v2 v2.9.0
)

replace github.com/docker/docker => github.com/moby/moby v0.7.3-0.20190826074503-38ab9da00309 // Required by Helm

replace github.com/openshift/api => github.com/openshift/api v0.0.0-20190924102528-32369d4db2ad // Required until https://github.com/operator-framework/operator-lifecycle-manager/pull/1241 is resolved
Loading

0 comments on commit 69c7633

Please sign in to comment.