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

Add preflight-lib reference #631

Merged

Conversation

sebrandon1
Copy link
Member

@sebrandon1 sebrandon1 commented Nov 2, 2022

Follow up to #592

Building upon work done by @komish in branch: https://github.com/komish/openshift-preflight/tree/add-lib-ha

  • Adds the preflight test suite.
  • Brings in external dependency from openshift-preflight repo.

pkg/provider/operators.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 2 times, most recently from 06aa033 to 7699a25 Compare November 4, 2022 15:12
greyerof added a commit to greyerof/certsuite that referenced this pull request Nov 7, 2022
Serialize the merged kube config into a temporary file and save the file
path so it can be read on demand.

This could be used by Brandon's wip redhat-best-practices-for-k8s#631 for the preflight lib
integration.
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 2 times, most recently from f1c7efc to 97743d9 Compare November 7, 2022 22:54
Copy link
Contributor

@greyerof greyerof left a comment

Choose a reason for hiding this comment

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

I've seen in the log output from the preflight checks that they're using tmp folders to create some files... we might have the same issue as in #644:
image

cnf-certification-test/preflight/suite.go Show resolved Hide resolved
sebrandon1 pushed a commit that referenced this pull request Nov 8, 2022
* Created merged kube config file in the clientsholder.

Serialize the merged kube config into a temporary file and save the file
path so it can be read on demand.

This could be used by Brandon's wip #631 for the preflight lib
integration.

* Add app's directory as alternative for temp files.
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 4 times, most recently from a58be1c to 359c12e Compare November 14, 2022 16:27
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 4 times, most recently from 1c3d3fb to e4b9ccc Compare November 16, 2022 22:00
@sebrandon1
Copy link
Member Author

Removing the proof of concept label. The refactor PR merged today and I have updated this PR to point at it.

redhat-openshift-ecosystem/openshift-preflight#825

This PR above merged into an upstream branch called lib but is still accessible via a go mod replace directive.

@sebrandon1
Copy link
Member Author

I'm currently checking through these failures:

Summarizing 4 Failures:
  [FAIL] preflight [It] preflight-HasUniqueTag [common, preflight, preflight-HasUniqueTag]
  /Users/bpalm/Repositories/go/src/github.com/test-network-function/cnf-certification-test/pkg/testhelper/testhelper.go:82
  [FAIL] preflight [It] preflight-RunAsNonRoot [common, preflight, preflight-RunAsNonRoot]
  /Users/bpalm/Repositories/go/src/github.com/test-network-function/cnf-certification-test/pkg/testhelper/testhelper.go:82
  [FAIL] preflight [It] preflight-HasLicense [common, preflight, preflight-HasLicense]
  /Users/bpalm/Repositories/go/src/github.com/test-network-function/cnf-certification-test/pkg/testhelper/testhelper.go:82
  [FAIL] preflight [It] preflight-DeployableByOLM [common, preflight, preflight-DeployableByOLM]
  /Users/bpalm/Repositories/go/src/github.com/test-network-function/cnf-certification-test/pkg/testhelper/testhelper.go:82

@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 3 times, most recently from b638692 to c0cf4da Compare November 18, 2022 15:10
@sebrandon1
Copy link
Member Author

For reviewers, do we have a preference if these preflight tests should be tagged TagCommon? What about how we classify them as telco/non-telco/etc @mwlinca?

@ramperher
Copy link
Collaborator

For reviewers, do we have a preference if these preflight tests should be tagged TagCommon? What about how we classify them as telco/non-telco/etc @mwlinca

From my point of view, until having an official resolution about how tnf and preflight will be tested, I would use a separate label for preflight, not including it within the common label

sf-project-io pushed a commit to redhat-cip/dci-openshift-app-agent that referenced this pull request Feb 8, 2023
…egration

build-depends: redhat-best-practices-for-k8s/certsuite#631

Test-App-Hints: tnf_test_example
Test-App-Args-Hints: -e {"dci_components_by_query":["type:tnf_test_example"]} -e do_cnf_cert=true -e {"tnf_config":[{"namespace":"test-cnf","targetpodlabels":["environment=test"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"mongodb-enterprise","exclude_connectivity_regexp":""},{"namespace":"production-cnf","targetpodlabels":["environment=production"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"","exclude_connectivity_regexp":""}]} -e test_network_function_version="HEAD" -e partner_creds=/opt/cache/partner_config.json -e dci_teardown_on_failure=false -e {"tnf_env_vars":{"TNF_NON_INTRUSIVE_ONLY":"false","TNF_RUN_CFD_TEST":"false","TNF_LOG_LEVEL":"debug","TNF_ALLOW_PREFLIGHT_INSECURE":"true"}}

Change-Id: Ib8d32cbcf6f94b1e09ec354dac94d55412cba67e
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 2 times, most recently from f999e48 to b40a024 Compare February 9, 2023 17:21
@sebrandon1
Copy link
Member Author

/dci-rerun

cnf-certification-test/preflight/suite.go Show resolved Hide resolved
pkg/provider/containers.go Outdated Show resolved Hide resolved
pkg/provider/containers.go Outdated Show resolved Hide resolved
pkg/provider/containers.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
pkg/provider/operators.go Outdated Show resolved Hide resolved
cnf-certification-test/preflight/suite.go Outdated Show resolved Hide resolved
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 3 times, most recently from da18b88 to b253f9d Compare February 10, 2023 21:51
@sebrandon1 sebrandon1 force-pushed the preflight_lib_ha branch 2 times, most recently from 68cb1cf to a574ee7 Compare February 13, 2023 14:53
Add operator support

Add unit test for container results

Use provided structs from lib

Switch to new funcs

work on cacheing

Add local Dockerfile

Controller-runtime upgrade

Modify scripts to mount docker config

Remove skipIfAny

Modify scripts to mount docker config

Add allow preflight insecure variable

Add .json to config var
@sebrandon1 sebrandon1 merged commit ba59e0a into redhat-best-practices-for-k8s:main Feb 14, 2023
@sebrandon1 sebrandon1 deleted the preflight_lib_ha branch February 14, 2023 19:20
fredericlepied pushed a commit to redhatci/ansible-collection-redhatci-ocp that referenced this pull request Jul 5, 2023
…preflight

Patch needed for redhat-best-practices-for-k8s/certsuite#804 and redhat-best-practices-for-k8s/certsuite#631.

When running tnf HEAD version:

- check if partner_creds variable is provided, else print a warning message
- prepare dockercfg file for tnf
- provide dockercfg file to tnf when using HEAD

patch already validated in connected env without PR804: https://www.distributed-ci.io/jobs/ba15b3a0-a544-491a-b5c8-604cf83ef52a/jobStates?sort=date
now testing the patch with PR804

build-depends: redhat-best-practices-for-k8s/certsuite#804

Test-App-Hints: tnf_test_example
Test-App-Args-Hints: -e {"dci_components_by_query":["type:tnf_test_example"]} -e do_cnf_cert=true -e {"tnf_config":[{"namespace":"test-cnf","targetpodlabels":["environment=test"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"mongodb-enterprise","exclude_connectivity_regexp":""},{"namespace":"production-cnf","targetpodlabels":["environment=production"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"","exclude_connectivity_regexp":""}]} -e {"tnf_env_vars":{"TNF_NON_INTRUSIVE_ONLY":"false","TNF_RUN_CFD_TEST":"false","TNF_LOG_LEVEL":"debug"}} -e test_network_function_version=HEAD -e partner_creds=/opt/cache/partner_config.json

Change-Id: I3393fca5b002be7cfcace89da2ed8364ffea8ae3
fredericlepied pushed a commit to redhatci/ansible-collection-redhatci-ocp that referenced this pull request Jul 5, 2023
…egration

build-depends: redhat-best-practices-for-k8s/certsuite#631

Test-App-Hints: tnf_test_example
Test-App-Args-Hints: -e {"dci_components_by_query":["type:tnf_test_example"]} -e do_cnf_cert=true -e {"tnf_config":[{"namespace":"test-cnf","targetpodlabels":["environment=test"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"mongodb-enterprise","exclude_connectivity_regexp":""},{"namespace":"production-cnf","targetpodlabels":["environment=production"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"","exclude_connectivity_regexp":""}]} -e test_network_function_version="HEAD" -e partner_creds=/opt/cache/partner_config.json -e dci_teardown_on_failure=false -e {"tnf_env_vars":{"TNF_NON_INTRUSIVE_ONLY":"false","TNF_RUN_CFD_TEST":"false","TNF_LOG_LEVEL":"debug","TNF_ALLOW_PREFLIGHT_INSECURE":"true"}}

Change-Id: Ib8d32cbcf6f94b1e09ec354dac94d55412cba67e
nocturnalastro pushed a commit to nocturnalastro/ansible-collection-redhatci-ocp that referenced this pull request Nov 9, 2023
…preflight

Patch needed for redhat-best-practices-for-k8s/certsuite#804 and redhat-best-practices-for-k8s/certsuite#631.

When running tnf HEAD version:

- check if partner_creds variable is provided, else print a warning message
- prepare dockercfg file for tnf
- provide dockercfg file to tnf when using HEAD

patch already validated in connected env without PR804: https://www.distributed-ci.io/jobs/ba15b3a0-a544-491a-b5c8-604cf83ef52a/jobStates?sort=date
now testing the patch with PR804

build-depends: redhat-best-practices-for-k8s/certsuite#804

Test-App-Hints: tnf_test_example
Test-App-Args-Hints: -e {"dci_components_by_query":["type:tnf_test_example"]} -e do_cnf_cert=true -e {"tnf_config":[{"namespace":"test-cnf","targetpodlabels":["environment=test"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"mongodb-enterprise","exclude_connectivity_regexp":""},{"namespace":"production-cnf","targetpodlabels":["environment=production"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"","exclude_connectivity_regexp":""}]} -e {"tnf_env_vars":{"TNF_NON_INTRUSIVE_ONLY":"false","TNF_RUN_CFD_TEST":"false","TNF_LOG_LEVEL":"debug"}} -e test_network_function_version=HEAD -e partner_creds=/opt/cache/partner_config.json

Change-Id: I3393fca5b002be7cfcace89da2ed8364ffea8ae3
nocturnalastro pushed a commit to nocturnalastro/ansible-collection-redhatci-ocp that referenced this pull request Nov 9, 2023
…egration

build-depends: redhat-best-practices-for-k8s/certsuite#631

Test-App-Hints: tnf_test_example
Test-App-Args-Hints: -e {"dci_components_by_query":["type:tnf_test_example"]} -e do_cnf_cert=true -e {"tnf_config":[{"namespace":"test-cnf","targetpodlabels":["environment=test"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"mongodb-enterprise","exclude_connectivity_regexp":""},{"namespace":"production-cnf","targetpodlabels":["environment=production"],"target_crds":["crdexamples.test-network-function.com"],"operators_regexp":"","exclude_connectivity_regexp":""}]} -e test_network_function_version="HEAD" -e partner_creds=/opt/cache/partner_config.json -e dci_teardown_on_failure=false -e {"tnf_env_vars":{"TNF_NON_INTRUSIVE_ONLY":"false","TNF_RUN_CFD_TEST":"false","TNF_LOG_LEVEL":"debug","TNF_ALLOW_PREFLIGHT_INSECURE":"true"}}

Change-Id: Ib8d32cbcf6f94b1e09ec354dac94d55412cba67e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants