Skip to content

[Feature]: Ability to validate individual workload and env sections #113

@nmaeding-ibmde

Description

@nmaeding-ibmde

Prerequisites

Problem Statement

I need to create a workload section and encrypt and can not ensure it is correct.
Same applies for env section.
contract-cli validate-contract exists but expects workload and env section

Proposed Solution

create dummy workload and env section or ignore part the schema

Alternatives Considered

cat > "$validation_file" << EOF
workload: |
$(sed 's/^/ /' "$workload_yaml_file")
env: |
type: env
logging:
logRouter:
hostname: "dummy.invalid"
port: 443
iamApiKey: "dummy"
EOF
validate-contract --in "${validation_file}" </dev/null >"${validation_log}" 2>&1

and
cat > "$validation_file" << EOF
workload: |
type: workload
auths:
dummy.invalid:
username: dummy
password: dummy
play:
resources:
- apiVersion: v1
kind: Pod
metadata:
name: dummy
spec:
restartPolicy: Never
containers:
- name: dummy
image: dummy.invalid/dummy:latest
env: |
$(sed 's/^/ /' "$env_yaml_file")
EOF
validate-contract --in "${validation_file}" </dev/null >"${validation_log}" 2>&1

Feature Category

Other

Target Platform

All platforms

Use Case

enable pre checks for multi-persona flow

Example CLI Usage

Priority

High - Would significantly improve my workflow

Breaking Change

No - Fully backward compatible

Additional Context

No response

Contribution

  • I would be willing to submit a PR to implement this feature
  • I can help test this feature once implemented
  • I can help write documentation for this feature

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions