Compare commits

...
5 Commits
Author SHA1 Message Date
Mike GravesandGitHub 2b51c229ad Prepare for 1.0.2 release (#70) 2021-02-19 12:03:23 -05:00
Mike GravesandGitHub d197d28cd1 Restrict kubernetes.core dependency version (#66)
* Restrict kubernetes.core dependency version

In order to better coordinate releases between this collection and the
kubernetes.core collection we need to use a more restrictive dependency
version range.

* Add changelog fragment
2021-02-19 10:38:31 -05:00
Mike GravesandGitHub 5361c9322e Remove has_action field from doc fragment (#68)
A recent change in Ansible
(https://github.com/ansible/ansible/commit/42da4807214cd609fd3c1800ab245c025ae044cd)
added a has_action field to the json output of ansible-doc. This started
causing the downstream sanity checks to fail.
2021-02-18 11:35:30 -05:00
Mike GravesandGitHub 6c1dc79c7f Fix doc string (#67)
* Fix doc string

The sanity tests fail due to missing default values on a few options in
the doc string. This change puts the doc string in alignment with the
argument spec.

* Fix case
2021-02-18 08:01:49 -05:00
Abhijeet KasurdeandGitHub 4cfbde3d14 Sanity check fixes for CI (#63)
Fixes: #62 #57

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-11-18 15:52:26 +01:00
10 changed files with 42 additions and 18 deletions
+8
View File
@@ -5,6 +5,14 @@ OKD Collection Release Notes
.. contents:: Topics .. contents:: Topics
v1.0.2
======
Minor Changes
-------------
- restrict the version of kubernetes.core dependency (https://github.com/ansible-collections/community.okd/pull/66).
v1.0.1 v1.0.1
====== ======
+1 -1
View File
@@ -1,5 +1,5 @@
# Also needs to be updated in galaxy.yml # Also needs to be updated in galaxy.yml
VERSION = 1.0.1 VERSION = 1.0.2
# To run sanity tests in a venv, set SANITY_TEST_ARGS to '--venv' # To run sanity tests in a venv, set SANITY_TEST_ARGS to '--venv'
SANITY_TEST_ARGS ?= --docker --color SANITY_TEST_ARGS ?= --docker --color
+1 -1
View File
@@ -39,7 +39,7 @@ You can also include it in a `requirements.yml` file and install it via `ansible
--- ---
collections: collections:
- name: community.okd - name: community.okd
version: 1.0.1 version: 1.0.2
``` ```
### Installing the OpenShift Python Library ### Installing the OpenShift Python Library
+7
View File
@@ -75,3 +75,10 @@ releases:
fragments: fragments:
- 59-downstream-docs.yml - 59-downstream-docs.yml
release_date: '2020-11-17' release_date: '2020-11-17'
1.0.2:
changes:
minor_changes:
- restrict the version of kubernetes.core dependency (https://github.com/ansible-collections/community.okd/pull/66).
fragments:
- 66-restrict-kubernetes-core-version.yaml
release_date: '2021-02-19'
@@ -0,0 +1,2 @@
minor_changes:
- restrict the version of kubernetes.core dependency (https://github.com/ansible-collections/community.okd/pull/66).
+6 -4
View File
@@ -1,4 +1,4 @@
#!/bin/bash -e #!/bin/bash -eu
# Script to dual-home the upstream and downstream Collection in a single repo # Script to dual-home the upstream and downstream Collection in a single repo
# #
@@ -9,7 +9,7 @@
# - All functions are prefixed with f_ so it's obvious where they come # - All functions are prefixed with f_ so it's obvious where they come
# from when in use throughout the script # from when in use throughout the script
DOWNSTREAM_VERSION="1.0.1" DOWNSTREAM_VERSION="1.0.2"
KEEP_DOWNSTREAM_TMPDIR="${KEEP_DOWNSTREAM_TMPDIR:-''}" KEEP_DOWNSTREAM_TMPDIR="${KEEP_DOWNSTREAM_TMPDIR:-''}"
_build_dir="" _build_dir=""
@@ -32,6 +32,7 @@ f_text_sub()
{ {
# Switch FQCN and dependent components # Switch FQCN and dependent components
OKD_sed_files="${_build_dir}/README.md ${_build_dir}/CHANGELOG.rst ${_build_dir}/changelogs/config.yaml ${_build_dir}/ci/downstream.sh ${_build_dir}/galaxy.yml" OKD_sed_files="${_build_dir}/README.md ${_build_dir}/CHANGELOG.rst ${_build_dir}/changelogs/config.yaml ${_build_dir}/ci/downstream.sh ${_build_dir}/galaxy.yml"
# shellcheck disable=SC2068
for okd_file in ${OKD_sed_files[@]}; do sed -i.bak "s/OKD/OpenShift/g" "${okd_file}"; done for okd_file in ${OKD_sed_files[@]}; do sed -i.bak "s/OKD/OpenShift/g" "${okd_file}"; done
sed -i.bak "s/============================/==================================/" "${_build_dir}/CHANGELOG.rst" sed -i.bak "s/============================/==================================/" "${_build_dir}/CHANGELOG.rst"
@@ -155,6 +156,8 @@ f_handle_doc_fragments_workaround()
do do
local module_py="plugins/modules/${doc_fragment_mod}.py" local module_py="plugins/modules/${doc_fragment_mod}.py"
f_log_info "Processing doc fragments for ${module_py}" f_log_info "Processing doc fragments for ${module_py}"
# We need following variable for ansible-doc only
# shellcheck disable=SC2097,SC2098
ANSIBLE_COLLECTIONS_PATH="${install_collections_dir}" \ ANSIBLE_COLLECTIONS_PATH="${install_collections_dir}" \
ANSIBLE_COLLECTIONS_PATHS="${ANSIBLE_COLLECTIONS_PATH}:${install_collections_dir}" \ ANSIBLE_COLLECTIONS_PATHS="${ANSIBLE_COLLECTIONS_PATH}:${install_collections_dir}" \
ansible-doc -j "redhat.openshift.${doc_fragment_mod}" > "${temp_fragments_json}" ansible-doc -j "redhat.openshift.${doc_fragment_mod}" > "${temp_fragments_json}"
@@ -166,9 +169,8 @@ f_handle_doc_fragments_workaround()
fi fi
"${PYTHON}" "${_start_dir}/ci/downstream_fragments.py" "redhat.openshift.${doc_fragment_mod}" "${temp_fragments_json}" "${PYTHON}" "${_start_dir}/ci/downstream_fragments.py" "redhat.openshift.${doc_fragment_mod}" "${temp_fragments_json}"
sed -n '/STARTREMOVE/q;p' "${module_py}" > "${temp_start}" sed -n '/STARTREMOVE/q;p' "${module_py}" > "${temp_start}"
sed '0,/ENDREMOVE/d' "${module_py}" > "${temp_end}" sed '1,/ENDREMOVE/d' "${module_py}" > "${temp_end}"
cat "${temp_start}" "${rendered_fragments}" "${temp_end}" > "${module_py}" cat "${temp_start}" "${rendered_fragments}" "${temp_end}" > "${module_py}"
cat "${module_py}"
done done
rm -f "${rendered_fragments}" rm -f "${rendered_fragments}"
rm -fr "${install_collections_dir}" rm -fr "${install_collections_dir}"
+5 -3
View File
@@ -1,8 +1,11 @@
#!/usr/bin/env python #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json import json
import yaml
import sys import sys
import yaml
with open("./rendereddocfragments.txt", 'w') as df_fd: with open("./rendereddocfragments.txt", 'w') as df_fd:
with open(sys.argv[2], 'r') as fd: with open(sys.argv[2], 'r') as fd:
@@ -10,6 +13,7 @@ with open("./rendereddocfragments.txt", 'w') as df_fd:
json_docs[sys.argv[1]]['doc'].pop('collection', '') json_docs[sys.argv[1]]['doc'].pop('collection', '')
json_docs[sys.argv[1]]['doc'].pop('filename', '') json_docs[sys.argv[1]]['doc'].pop('filename', '')
json_docs[sys.argv[1]]['doc'].pop('has_action', '')
df_fd.write("DOCUMENTATION = '''\n") df_fd.write("DOCUMENTATION = '''\n")
df_fd.write(yaml.dump(json_docs[sys.argv[1]]['doc'], default_flow_style=False)) df_fd.write(yaml.dump(json_docs[sys.argv[1]]['doc'], default_flow_style=False))
@@ -22,5 +26,3 @@ with open("./rendereddocfragments.txt", 'w') as df_fd:
df_fd.write("RETURN = '''\n") df_fd.write("RETURN = '''\n")
df_fd.write(yaml.dump(json_docs[sys.argv[1]]['return'], default_flow_style=False)) df_fd.write(yaml.dump(json_docs[sys.argv[1]]['return'], default_flow_style=False))
df_fd.write("'''\n\n") df_fd.write("'''\n\n")
+8 -7
View File
@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash -eu
set -x set -x
@@ -11,17 +11,18 @@ NAMESPACE=${NAMESPACE:-default}
# and set the IMAGE_FORMAT environment variable so that it properly # and set the IMAGE_FORMAT environment variable so that it properly
# resolves to your image. For example, quay.io/mynamespace/$component # resolves to your image. For example, quay.io/mynamespace/$component
# would resolve to quay.io/mynamespace/molecule-test-runner # would resolve to quay.io/mynamespace/molecule-test-runner
# shellcheck disable=SC2034
component='molecule-test-runner' component='molecule-test-runner'
eval IMAGE=$IMAGE_FORMAT eval IMAGE="$IMAGE_FORMAT"
PULL_POLICY=${PULL_POLICY:-IfNotPresent} PULL_POLICY=${PULL_POLICY:-IfNotPresent}
if ! oc get namespace $NAMESPACE if ! oc get namespace "$NAMESPACE"
then then
oc create namespace $NAMESPACE oc create namespace "$NAMESPACE"
fi fi
oc project $NAMESPACE oc project "$NAMESPACE"
oc adm policy add-cluster-role-to-user cluster-admin -z default oc adm policy add-cluster-role-to-user cluster-admin -z default
oc adm policy who-can create projectrequests oc adm policy who-can create projectrequests
@@ -52,7 +53,7 @@ spec:
EOF EOF
function check_success { function check_success {
oc wait --for=condition=complete job/molecule-integration-test --timeout 5s -n $NAMESPACE \ oc wait --for=condition=complete job/molecule-integration-test --timeout 5s -n "$NAMESPACE" \
&& oc logs job/molecule-integration-test \ && oc logs job/molecule-integration-test \
&& echo "Molecule integration tests ran successfully" \ && echo "Molecule integration tests ran successfully" \
&& return 0 && return 0
@@ -60,7 +61,7 @@ function check_success {
} }
function check_failure { function check_failure {
oc wait --for=condition=failed job/molecule-integration-test --timeout 5s -n $NAMESPACE \ oc wait --for=condition=failed job/molecule-integration-test --timeout 5s -n "$NAMESPACE" \
&& oc logs job/molecule-integration-test \ && oc logs job/molecule-integration-test \
&& echo "Molecule integration tests failed, see logs for more information..." \ && echo "Molecule integration tests failed, see logs for more information..." \
&& return 0 && return 0
+2 -2
View File
@@ -5,7 +5,7 @@ authors:
- willthames (https://github.com/willthames) - willthames (https://github.com/willthames)
- Akasurde (https://github.com/akasurde) - Akasurde (https://github.com/akasurde)
dependencies: dependencies:
kubernetes.core: '>=1.1.1' kubernetes.core: '>=1.1.1,<1.2.0'
description: OKD Collection for Ansible. description: OKD Collection for Ansible.
documentation: '' documentation: ''
homepage: '' homepage: ''
@@ -24,4 +24,4 @@ tags:
- okd - okd
- cluster - cluster
# Also needs to be updated in the Makefile # Also needs to be updated in the Makefile
version: 1.0.1 version: 1.0.2
+2
View File
@@ -134,6 +134,7 @@ options:
will only work if the same object is passed with state=absent (alternatively, just use state=absent with the name including will only work if the same object is passed with state=absent (alternatively, just use state=absent with the name including
the generated hash and append_hash=no) the generated hash and append_hash=no)
type: bool type: bool
default: false
apply: apply:
description: description:
- C(apply) compares the desired resource definition with the previously supplied resource definition, - C(apply) compares the desired resource definition with the previously supplied resource definition,
@@ -141,6 +142,7 @@ options:
- C(apply) works better with Services than 'force=yes' - C(apply) works better with Services than 'force=yes'
- mutually exclusive with C(merge_type) - mutually exclusive with C(merge_type)
type: bool type: bool
default: false
requirements: requirements:
- "python >= 2.7" - "python >= 2.7"