SUSE / cap

Apache License 2.0
2 stars 1 forks source link

`config.logs.enabled=true` when `config.jobs.deploy-k8s-false` is broken #51

Open viccuad opened 3 years ago

viccuad commented 3 years ago

Using the following config file:

(note logs.enabled=true and jobs.deploy-k8s=false)

workertags:
  caasp4: suse-internal

jobs:
  deploy-k8s: false
  deploy-kubecf: true
  smoke-tests: true
  cf-acceptance-tests-brain: false
  sync-integration-tests: false
  minibroker-integration-tests: false
  cf-acceptance-tests: false
  upgrade-kubecf: false
  deploy-stratos: false
  destroy-kubecf: true
jobs_ordered:
- deploy-k8s
- deploy-kubecf
- smoke-tests
- cf-acceptance-tests-brain
- sync-integration-tests
- minibroker-integration-tests
- cf-acceptance-tests
- upgrade-kubecf
- deploy-stratos
- destroy-kubecf
backends:
  caasp4: true
  aks: false
  gke: false
  eks: false
availabilities:
  sa: true
  ha: false
  all: false
schedulers:
  diego: true
  eirini: false
catapult:
  uri: https://github.com/SUSE/catapult
  branch: master
brain:
  verbose: false
  inorder: false
  include: ""
  exclude: ""
cats:
  nodes: 3
  flake-attempts: 5
  timeout-scale: "3.0"
s3minibroker:
  bucket: minibroker-helm-charts
  region: us-east-1
  regexp: minibroker-charts/minibroker-(.*).tgz
s3:
  bucket: kubecf
  region: us-west-2
  regexp: kubecf-bundle-v(.*).tgz
# Scheduling is required for nightly builds, enabling it removes regular trigger on kubecf bundle.
schedule:
  enabled: false
  start: 12:00 AM
  stop: 12:10 AM
  location: America/Vancouver
logs:
  enabled: true

Gives me:

apply configuration? [yN]: y
error: invalid pipeline config:
invalid resources:
        resource 's3.klog-destination' is not used
viccuad commented 3 years ago

This is happening because the klog script is only called inside the destroy-k8s task: https://github.com/SUSE/cap/blob/515c930fd6e235099fd1feef1fa62bbed733496b/cap-ci/common/destroy_k8s.tmpl#L40-L52

Yet (rightly) the definition of the resource has nothing to do with destroy_k8s: https://github.com/SUSE/cap/blob/515c930fd6e235099fd1feef1fa62bbed733496b/cap-ci/pipeline.yaml.tmpl#L88-L98

Possible solutions:

prabalsharma commented 3 years ago

There is a fundamental issue of design here. klog should not be part of destroy k8s job (aka destroy-kubecf flag) https://jira.suse.com/browse/CAP-1564