Skip to content

Commit

Permalink
Add autoscaling.cast.ai/disposable annotation (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Nov 16, 2023
1 parent 9a8e509 commit 4db8ff3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions imagescan/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ func scanJobSpec(
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Namespace: ns,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app.kubernetes.io/managed-by": "castai",
},
Expand Down
3 changes: 3 additions & 0 deletions imagescan/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func TestScanner(t *testing.T) {
APIVersion: "batch/v1",
},
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Name: "imgscan-1ba98dcd098ba64e9b2fe4dafc7a5c85",
Namespace: ns,
Labels: map[string]string{
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/aks.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func AKS(nodeName, jobName string) *batchv1.Job {
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app": "kube-bench",
"app.kubernetes.io/managed-by": "castai",
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func EKS(nodeName, jobName string) *batchv1.Job {
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app": "kube-bench",
"app.kubernetes.io/managed-by": "castai",
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func GKE(nodeName, jobName string) *batchv1.Job {
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app": "kube-bench",
"app.kubernetes.io/managed-by": "castai",
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func Master(nodeName, jobName string) *batchv1.Job {
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app": "kube-bench",
"app.kubernetes.io/managed-by": "castai",
Expand Down
3 changes: 3 additions & 0 deletions linters/kubebench/spec/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ func Node(nodeName, jobName string) *batchv1.Job {
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Annotations: map[string]string{
"autoscaling.cast.ai/disposable": "true",
},
Labels: map[string]string{
"app": "kube-bench",
"app.kubernetes.io/managed-by": "castai",
Expand Down

0 comments on commit 4db8ff3

Please sign in to comment.