Skip to content
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

[installer]: correct the starts_with validation on the config #7206

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

mrsimonemms
Copy link
Contributor

@mrsimonemms mrsimonemms commented Dec 13, 2021

Description

The validation was just being printed to terminal, not passed into the validation result. This corrects the mistake

Related Issue(s)

Fixes #7205

How to test

  1. Generate a config installer init > config.yaml
  2. Remove the / at the start of workspace.runtime.containerdRuntimeDir
  3. Run installer validate config -c config.yaml

This should now bring the validation error out and exit with non-zero

Release Notes

[installer]: correct the starts_with validation on the config

Documentation

The validation was just being printed to terminal, not passed into the
validation result.
@mrsimonemms mrsimonemms added component: install Terraform installation scripts, helm charts, installer images team: workspace Issue belongs to the Workspace team team: delivery Issue belongs to the self-hosted team labels Dec 13, 2021
@mrsimonemms mrsimonemms requested a review from a team December 13, 2021 14:07
@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #7206 (91f3039) into main (300a805) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7206   +/-   ##
=====================================
  Coverage   5.76%   5.76%           
=====================================
  Files         13      13           
  Lines       1162    1162           
=====================================
  Hits          67      67           
  Misses      1094    1094           
  Partials       1       1           
Flag Coverage Δ
installer-raw-app 5.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ced67ae...91f3039. Read the comment docs.

Copy link
Contributor

@princerachit princerachit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test passed:

gitpod /workspace/gitpod/installer $ installer validate config -c config
{
  "valid": false,
  "fatal": [
    "Field 'Config.Workspace.Runtime.ContainerDRuntimeDir' must start with '/'"
  ]
}
Error: configuration invalid
Usage:
  gitpod-installer validate config [flags]

Flags:
  -h, --help   help for config

Global Flags:
  -c, --config string               path to the config file
      --debug-version-file string   path to a version manifest - not intended for production use

Error: configuration invalid
gitpod /workspace/gitpod/installer $ echo $?
1
gitpod /workspace/gitpod/installer $ 

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: c33d780bd0748f78045ce7674e731af85805d825

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: princerachit

Associated issue: #7205

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit e6f4bff into main Dec 14, 2021
@roboquat roboquat deleted the sje/installer-starts-with-validation branch December 14, 2021 08:40
@roboquat roboquat added the deployed: workspace Workspace team change is running in production label Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component: install Terraform installation scripts, helm charts, installer images deployed: workspace Workspace team change is running in production release-note size/XS team: delivery Issue belongs to the self-hosted team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[installer]: containerd runtime dir validation doesn't error
3 participants