diff --git a/PROJECT b/PROJECT index 13ee26d7..68dabd68 100644 --- a/PROJECT +++ b/PROJECT @@ -1,3 +1,7 @@ +# Code generated by tool. DO NOT EDIT. +# This file is used to track the info used to scaffold your project +# and allow the plugins properly work. +# More info: https://book.kubebuilder.io/reference/project-config.html domain: ansible.com layout: - ansible.sdk.operatorframework.io/v1 @@ -27,4 +31,11 @@ resources: group: awx kind: AWXRestore version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + domain: ansible.com + group: awx + kind: AWXMeshIngress + version: v1alpha1 version: "3" diff --git a/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml b/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml new file mode 100644 index 00000000..4203855c --- /dev/null +++ b/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: awxmeshingresses.awx.ansible.com +spec: + group: awx.ansible.com + names: + kind: AWXMeshIngress + listKind: AWXMeshIngressList + plural: awxmeshingresses + singular: awxmeshingress + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: AWXMeshIngress is the Schema for the awxmeshingresses API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of AWXMeshIngress + type: object + x-kubernetes-preserve-unknown-fields: true + status: + description: Status defines the observed state of AWXMeshIngress + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 166d9f09..d8d563ed 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -5,4 +5,5 @@ resources: - bases/awx.ansible.com_awxs.yaml - bases/awx.ansible.com_awxbackups.yaml - bases/awx.ansible.com_awxrestores.yaml +- bases/awx.ansible.com_awxmeshingresses.yaml #+kubebuilder:scaffold:crdkustomizeresource diff --git a/config/rbac/awxmeshingress_editor_role.yaml b/config/rbac/awxmeshingress_editor_role.yaml new file mode 100644 index 00000000..eb40935b --- /dev/null +++ b/config/rbac/awxmeshingress_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit awxmeshingresses. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: awxmeshingress-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: awx-operator + app.kubernetes.io/part-of: awx-operator + app.kubernetes.io/managed-by: kustomize + name: awxmeshingress-editor-role +rules: +- apiGroups: + - awx.ansible.com + resources: + - awxmeshingresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - awx.ansible.com + resources: + - awxmeshingresses/status + verbs: + - get diff --git a/config/rbac/awxmeshingress_viewer_role.yaml b/config/rbac/awxmeshingress_viewer_role.yaml new file mode 100644 index 00000000..4a2d0acd --- /dev/null +++ b/config/rbac/awxmeshingress_viewer_role.yaml @@ -0,0 +1,27 @@ +# permissions for end users to view awxmeshingresses. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: awxmeshingress-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: awx-operator + app.kubernetes.io/part-of: awx-operator + app.kubernetes.io/managed-by: kustomize + name: awxmeshingress-viewer-role +rules: +- apiGroups: + - awx.ansible.com + resources: + - awxmeshingresses + verbs: + - get + - list + - watch +- apiGroups: + - awx.ansible.com + resources: + - awxmeshingresses/status + verbs: + - get diff --git a/config/samples/awx_v1alpha1_awxmeshingress.yaml b/config/samples/awx_v1alpha1_awxmeshingress.yaml new file mode 100644 index 00000000..fedf609b --- /dev/null +++ b/config/samples/awx_v1alpha1_awxmeshingress.yaml @@ -0,0 +1,12 @@ +apiVersion: awx.ansible.com/v1alpha1 +kind: AWXMeshIngress +metadata: + labels: + app.kubernetes.io/name: awxmeshingress + app.kubernetes.io/instance: awxmeshingress-sample + app.kubernetes.io/part-of: awx-operator + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: awx-operator + name: awxmeshingress-sample +spec: + # TODO(user): Add fields here diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 0dc07e09..61466cec 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -3,4 +3,5 @@ resources: - awx_v1beta1_awx.yaml - awx_v1beta1_awxbackup.yaml - awx_v1beta1_awxrestore.yaml +- awx_v1alpha1_awxmeshingress.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/molecule/default/tasks/awxmeshingress_test.yml b/molecule/default/tasks/awxmeshingress_test.yml new file mode 100644 index 00000000..6b1dadeb --- /dev/null +++ b/molecule/default/tasks/awxmeshingress_test.yml @@ -0,0 +1,18 @@ +--- +- name: Create the awx.ansible.com/v1alpha1.AWXMeshIngress + k8s: + state: present + namespace: '{{ namespace }}' + definition: "{{ lookup('template', '/'.join([samples_dir, cr_file])) | from_yaml }}" + wait: yes + wait_timeout: 300 + wait_condition: + type: Successful + status: "True" + vars: + cr_file: 'awx_v1alpha1_awxmeshingress.yaml' + +- name: Add assertions here + assert: + that: false + fail_msg: FIXME Add real assertions for your operator diff --git a/playbooks/awxmeshingress.yml b/playbooks/awxmeshingress.yml new file mode 100644 index 00000000..7a0295bf --- /dev/null +++ b/playbooks/awxmeshingress.yml @@ -0,0 +1,7 @@ +--- +- hosts: localhost + gather_facts: no + collections: + - kubernetes.core + - operator_sdk.util + tasks: [] diff --git a/watches.yaml b/watches.yaml index 10dd3275..3ea931f9 100644 --- a/watches.yaml +++ b/watches.yaml @@ -22,4 +22,8 @@ kind: AWXRestore role: restore snakeCaseParameters: False +- version: v1alpha1 + group: awx.ansible.com + kind: AWXMeshIngress + playbook: playbooks/awxmeshingress.yml # +kubebuilder:scaffold:watch