Skip to content

feat: add skip_schema_validation to app_v2 - #2298

Merged
matttrach merged 2 commits into
release/v15from
backport-2294-release-v15
Jun 25, 2026
Merged

feat: add skip_schema_validation to app_v2#2298
matttrach merged 2 commits into
release/v15from
backport-2294-release-v15

Conversation

@github-actions

Copy link
Copy Markdown

This pull request cherry-picks the changes from #2294 into release/v15

Addresses #2296 for #2295

WARNING!: to avoid having to resolve merge conflicts this PR is generated with 'git cherry-pick -X theirs'.

Please make sure to carefully inspect this PR so that you don't accidentally revert anything!

Copied from main PR:

Description

Allows for installing applications using the Helm flag --skip-schema-validation, which is useful for airgap environments.

In order to do so, I've also upgraded the rancher/rancher dependency to a newer version to support the new field, added in rancher/rancher#55004. The rest of the dependency upgrades are automatically generated by go mod tidy.

Testing

Sample configuration trying to install a chart with a broken schema with skip_schema_validation set to false:

resource "rancher2_catalog_v2" "test_cluster_repo" {
  cluster_id = "local"  # Replace with your cluster ID
  name       = "test"

  git_repo   = "https://github.com/alemorcuq/charts.git"
  git_branch = "test-wp"
}

resource "rancher2_app_v2" "test_skip_validation" {
  depends_on = [rancher2_catalog_v2.test_cluster_repo]
  cluster_id = "local"  # Replace with your cluster ID
  name       = "wordpress"
  namespace  = "default"

  repo_name     = "test"
  chart_name    = "wordpress"
  chart_version = "27.0.0" # Example rancher-backup chart version

  # TESTING THE NEW FIELD:
  # This skips helm's values.schema.json validation during chart install & upgrade.
  # Extremely useful in offline or air-gapped systems where external references ($ref) fail.
  skip_schema_validation = false
}

Results in an error:

rancher2_catalog_v2.test_cluster_repo: Creating...
rancher2_catalog_v2.test_cluster_repo: Creation complete after 4s [id=local.test]
rancher2_app_v2.test_skip_validation: Creating...
╷
│ Error: [ERROR] installing App V2: helm install --labels=catalog.cattle.io/cluster-repo-name=test --namespace=default --timeout=10m0s --values=/home/shell/helm/values-wordpress-27.0.0.yaml --version=27.0.0 --wait=true wordpress /home/shell/helm/wordpress-27.0.0.tgz
│ Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
│ wordpress:
│ "file:///values.schema.json#" is not valid against metaschema: jsonschema validation failed with 'https://json-schema.org/draft/2020-12/schema#'
│ - at '': 'allOf' failed
│   - at '/properties/wordpressUsername': 'allOf' failed
│     - at '/properties/wordpressUsername/type': 'anyOf' failed
│       - at '/properties/wordpressUsername/type': value must be one of 'array', 'boolean', 'integer', 'null', 'number', 'object', 'string'
│       - at '/properties/wordpressUsername/type': got string, want array
│
│
│   with rancher2_app_v2.test_skip_validation,
│   on test_skip_schema_validation.tf line 33, in resource "rancher2_app_v2" "test_skip_validation":
│   33: resource "rancher2_app_v2" "test_skip_validation" {

However, when skip_schema_validation is set to true:

resource "rancher2_catalog_v2" "test_cluster_repo" {
  cluster_id = "local"  # Replace with your cluster ID
  name       = "test"

  git_repo   = "https://github.com/alemorcuq/charts.git"
  git_branch = "test-wp"
}

resource "rancher2_app_v2" "test_skip_validation" {
  depends_on = [rancher2_catalog_v2.test_cluster_repo]
  cluster_id = "local"  # Replace with your cluster ID
  name       = "wordpress"
  namespace  = "default"

  repo_name     = "test"
  chart_name    = "wordpress"
  chart_version = "27.0.0" # Example rancher-backup chart version

  # TESTING THE NEW FIELD:
  # This skips helm's values.schema.json validation during chart install & upgrade.
  # Extremely useful in offline or air-gapped systems where external references ($ref) fail.
  skip_schema_validation = true
}

It succeeds:

rancher2_app_v2.test_skip_validation: Creating...
rancher2_app_v2.test_skip_validation: Still creating... [10s elapsed]
rancher2_app_v2.test_skip_validation: Still creating... [20s elapsed]
rancher2_app_v2.test_skip_validation: Still creating... [30s elapsed]
rancher2_app_v2.test_skip_validation: Still creating... [40s elapsed]
rancher2_app_v2.test_skip_validation: Still creating... [50s elapsed]
rancher2_app_v2.test_skip_validation: Creation complete after 58s [id=local.default/wordpress]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Not a breaking change since the flag is optional and the default behavior is false.

Allows for installing applications using the Helm flag
--skip-schema-validation, which is useful for air-gapped
environments.

(cherry picked from commit e4d6579)
@github-actions github-actions Bot added internal/pr-backport This PR is back porting code to a release branch. release/v15 Targets release v15.x correlating to Rancher's v2.15.x labels Jun 18, 2026
@matttrach
matttrach requested a review from alemorcuq June 18, 2026 18:29
@matttrach

Copy link
Copy Markdown
Member

Signed-off-by: matttrach <matt.trachier@suse.com>
@matttrach
matttrach merged commit b1f8bd7 into release/v15 Jun 25, 2026
9 checks passed
@matttrach
matttrach deleted the backport-2294-release-v15 branch June 25, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal/pr-backport This PR is back porting code to a release branch. release/v15 Targets release v15.x correlating to Rancher's v2.15.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants