-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/trivy-plugin
# Conflicts: # charts/zora/README.md # charts/zora/templates/plugins/rbac.yaml # charts/zora/values.yaml # config/rbac/zora_plugins_role.yaml # pkg/plugins/cronjob.go
- Loading branch information
Showing
29 changed files
with
1,048 additions
and
1,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# Zora (Alpha Release) | ||
|
||
<div align="center"> | ||
|
||
<a href="https://zora-docs.undistro.io/" target="_blank"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
1. Connect clusters with `kubectl`: | ||
Thank you for installing {{ .Chart.Name | title }} version {{ .Chart.Version }}. | ||
|
||
For in-depth information about how to connect a cluster, visit | ||
https://zora-docs.undistro.io/ | ||
{{ if .Values.clusterName -}} | ||
Cluster `{{ .Values.clusterName }}` is scheduled to be scanned. Check it by running: | ||
kubectl get cluster,clusterscan -o wide -n {{ .Release.Namespace }} | ||
|
||
{{- if .Values.saas.workspaceID }} | ||
2. Now you can see your clusters and issues in the SaaS: | ||
{{ .Values.saas.server }} | ||
Once a cluster is successfully scanned, you can check issues by running: | ||
kubectl get clusterissues -n {{ .Release.Namespace }} | ||
|
||
{{ end -}} | ||
|
||
Visit our documentation for in-depth information: https://zora-docs.undistro.io | ||
|
||
{{ if .Values.saas.workspaceID -}} | ||
You can see your clusters and issues in SaaS: {{ .Values.saas.server }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2023 Undistro 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, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
{{ if .Values.clusterName }} | ||
apiVersion: zora.undistro.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
labels: | ||
{{- include "zora.labels" . | nindent 4 }} | ||
name: {{ include "clusterName" . }} | ||
spec: {} | ||
--- | ||
apiVersion: zora.undistro.io/v1alpha1 | ||
kind: ClusterScan | ||
metadata: | ||
labels: | ||
{{- include "zora.labels" . | nindent 4 }} | ||
name: {{ include "clusterName" . }} | ||
spec: | ||
clusterRef: | ||
name: {{ include "clusterName" . }} | ||
schedule: {{ include "scanSchedule" . | quote }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2023 Undistro 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, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package worker | ||
|
||
import ( | ||
"strings" | ||
"time" | ||
|
||
"github.com/caarlos0/env/v9" | ||
) | ||
|
||
// config represents worker configuration | ||
type config struct { | ||
DoneFile string `env:"DONE_FILE" envDefault:"/tmp/zora/results/done"` | ||
ErrorFile string `env:"ERROR_FILE" envDefault:"/tmp/zora/results/error"` | ||
PluginName string `env:"PLUGIN_NAME,required"` | ||
ClusterName string `env:"CLUSTER_NAME,required"` | ||
Namespace string `env:"NAMESPACE,required"` | ||
JobName string `env:"JOB_NAME,required"` | ||
JobUID string `env:"JOB_UID,required"` | ||
PodName string `env:"POD_NAME,required"` | ||
WaitInterval time.Duration `env:"WAIT_INTERVAL" envDefault:"1s"` | ||
|
||
suffix string | ||
} | ||
|
||
// configFromEnv returns a config from environment variables | ||
func configFromEnv() (*config, error) { | ||
cfg := &config{} | ||
if err := env.Parse(cfg); err != nil { | ||
return nil, err | ||
} | ||
if i := strings.LastIndex(cfg.PodName, "-"); i > 0 && len(cfg.PodName) > i+1 { | ||
cfg.suffix = cfg.PodName[i+1:] | ||
} | ||
return cfg, nil | ||
} |
Oops, something went wrong.