-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation and uploading of jobs configuration #127
Conversation
|
||
## Overview | ||
|
||
This command is responsible for uploading Prow configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be more specific: which configuration
## Overview | ||
|
||
This command is responsible for uploading Prow configuration. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I add a new job, should I run this command? Probably not, because we have config updater. We should mention that you update jobs using this tool when a new cluster is provisioned (for production cluster or for "forked" clusters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My proposal: Use it for a newly created Prow cluster or to update changes in the configuration on a cluster from a forked repository that does not use config-updater?
return err | ||
} | ||
|
||
func uploadFromFiles(name, path string, client configMapSetter) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider renaming: updateConfigMapFromDirecotry and uploadFromFile --> updateConfigMapFromFile.
Additionally, it is updating or replacing?
|
||
func TestUploadFromFile(t *testing.T) { | ||
//given | ||
tmpDir, err := ioutil.TempDir("", "TestFindAllRec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: prefix should be the same as a test name
development/tools/pkg/file/file.go
Outdated
"path/filepath" | ||
) | ||
|
||
func FindAllRec(rootPath, extension string) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name of this function is cryptic for me
return &result, nil | ||
} | ||
|
||
func configMapFromFiles(name, rootPath string) (*v1.ConfigMap, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: maybe better name will be: configMapFromYamlsInDir
|
||
## Usage | ||
|
||
To run, use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, add information that we make an assumption that configmaps already exist
|
||
This command is responsible for uploading Prow configuration. | ||
|
||
## Usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this tool has to be used for production cluster, please update documentation how to configure production cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
| --kubeconfig | Yes | The path to the kubeconfig file, needed for connecting to the cluster. | | ||
| --config-path | No | The path to the `config.yaml` file. If set, the configuration will be uploaded. | | ||
| --jobs-config-path | No | The path to the directory with job configurations. If set, the job configurations will be uploaded. | | ||
| --plugin-config-path | No | The path to the `plugins.yaml` file. If set, the plugins configuration will be uploaded. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think --plugins-config-path
would be better.
return err | ||
} | ||
|
||
func configMapFromFile(name, path string) (*v1.ConfigMap, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should either merge these two functions or name this one as configMapFromSingleFile
. Otherwise, they can be mixed up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
command: | ||
- "/home/prow/go/src/github.com/kyma-project/test-infra/development/validate-scripts.sh" | ||
- name: prow/test-infra/validate-configs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have a job to check if config uploader compiles - please fix it here or create a follow up task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up created: #134
development/README.md
Outdated
<!-- Update the project structure each time you modify it. --> | ||
|
||
``` | ||
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of the "config.yaml" and "plugins.yaml" files | ||
├── check.sh # This script runs the "Checker" application. . | ||
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of the "config.yaml", "plugins.yaml" files and job configurations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of the "config.yaml", "plugins.yaml" files and job configurations. | |
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of jobs, "config.yaml", and "plugins.yaml". |
development/README.md
Outdated
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of the "config.yaml" and "plugins.yaml" files | ||
├── check.sh # This script runs the "Checker" application. . | ||
├── checker # This folder contains code sources of a simple Go application that verifies the configuration of the "config.yaml", "plugins.yaml" files and job configurations. | ||
├── tools # This folder contains code sources of a Go applications for test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
├── tools # This folder contains code sources of a Go applications for test-infra repository. | |
├── tools # This folder contains code sources of Go applications for the "test-infra" repository. |
development/README.md
Outdated
├── create-gcp-secrets.sh # This script downloads Secrets from the GCP storage bucket to your Prow installation. | ||
├── install-prow.sh # This script installs Prow on your cluster. | ||
├── provision-cluster.sh # This script creates a Kubernetes cluster. | ||
├── remove-prow.sh # This script removes Prow from your Kubernetes cluster. | ||
├── update-config.sh # This script updates the new configuration of the "config.yaml" file on a cluster. | ||
├── update-jobs.sh # This script updates the new configuration of the job configurations on a cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
├── update-jobs.sh # This script updates the new configuration of the job configurations on a cluster. | |
├── update-jobs.sh # This script updates the new configuration of the jobs on a cluster. |
development/tools/README.md
Outdated
go run cmd/configuploader/main.go --kubeconfig $HOME/.kube/config --plugin-config-path {pathToPluginsYaml} | ||
``` | ||
|
||
For details how to run commands, go to `cmd` directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For details how to run commands, go to `cmd` directory. | |
For details on flags to use with the command, go to the `cmd` directory. |
development/tools/README.md
Outdated
|
||
## Overview | ||
|
||
This project contains Go applications for test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project contains Go applications for test-infra repository. | |
This project contains Go applications for the `test-infra` repository. |
| --kubeconfig | Yes | The path to the kubeconfig file, needed for connecting to the cluster. | | ||
| --config-path | No | The path to the `config.yaml` file. If set, the configuration will be uploaded. | | ||
| --jobs-config-path | No | The path to the directory with job configurations. If set, the job configurations will be uploaded. | | ||
| --plugin-config-path | No | The path to the `plugins.yaml` file. If set, the plugins configuration will be uploaded. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| --plugin-config-path | No | The path to the `plugins.yaml` file. If set, the plugins configuration will be uploaded. | | |
| **--plugin-config-path** | No | The path to the `plugins.yaml` file. Set it to upload plugin configurations to a cluster. | |
go run cmd/configuploader/main.go --kubeconfig $HOME/.kube/config --plugin-config-path {pathToPluginsYaml} | ||
``` | ||
|
||
## Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Parameters | |
### Flags |
@@ -2,7 +2,7 @@ | |||
|
|||
This instruction provides the steps required to deploy your own Prow on a forked repository for test and development purposes. | |||
|
|||
> **NOTE:** The following instructions assume that you are signed in to the Google Cloud project with administrative rights and that you have the $GOPATH already set. | |||
> **NOTE:** The following instructions assume that you are signed in to the Google Cloud project with administrative rights and that you have the \$GOPATH already set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> **NOTE:** The following instructions assume that you are signed in to the Google Cloud project with administrative rights and that you have the \$GOPATH already set. | |
> **NOTE:** The following instructions assume that you are signed in to the Google Cloud project with administrative rights and that you have the `$GOPATH` already set. |
@@ -162,12 +161,18 @@ If the files are configured correctly, upload the files on a cluster. | |||
./update-plugins.sh ../prow/plugins.yaml | |||
``` | |||
|
|||
2. Use the `update-config.sh {file_path}` script to apply jobs configuration on a cluster. | |||
2. Use the `update-config.sh {file_path}` script to apply prow configuration on a cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Use the `update-config.sh {file_path}` script to apply prow configuration on a cluster. | |
2. Use the `update-config.sh {file_path}` script to apply Prow configuration on a cluster. |
|
||
## Overview | ||
|
||
This command is responsible for uploading Prow configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command is responsible for uploading Prow configuration. | |
This command is responsible for uploading Prow configuration to a Prow cluster. |
@michal-hudy: Updated the
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Description
Changes proposed in this pull request:
Related issue(s)
See #87