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

Update Dockerfile and playbook for newer operator-sdk and ansible #883

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
FROM quay.io/operator-framework/ansible-operator:v1.30
FROM quay.io/operator-framework/ansible-operator:latest

COPY requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible

COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
6 changes: 6 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- name: operator_sdk.util
version: "0.5.0"
- name: kubernetes.core
version: "2.4.0"
32 changes: 16 additions & 16 deletions roles/migrationcontroller/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
when: additional_excluded_resources is defined and item is not in excluded_resources

- name: "Check for existing velero controller from MTC <1.7.0"
k8s_facts:
k8s_info:
api_version: "apps/v1"
kind: Deployment
name: velero
Expand All @@ -74,7 +74,7 @@
- velero_status.resources[0].metadata.ownerReferences[0].kind == "MigrationController"

- name: "Check for existing restic daemonset from MTC <1.7.0"
k8s_facts:
k8s_info:
api_version: "apps/v1"
kind: DaemonSet
name: restic
Expand All @@ -94,7 +94,7 @@
- restic_status.resources[0].metadata.ownerReferences[0].kind == "MigrationController"

- name: "Check for existing restic-restore-action-config configmap from MTC <1.7.0"
k8s_facts:
k8s_info:
api_version: "v1"
kind: ConfigMap
name: restic-restore-action-config
Expand All @@ -114,7 +114,7 @@
- restic_restore_config.resources[0].metadata.ownerReferences[0].kind == "MigrationController"

- name: Get cluster config
k8s_facts:
k8s_info:
api_version: v1
kind: Namespace
name: openshift-config
Expand All @@ -125,7 +125,7 @@
when: config_namespace_check.resources|length > 0

- name: Get the infrastructure
k8s_facts:
k8s_info:
api_version: config.openshift.io/v1
kind: Infrastructure
name: cluster
Expand Down Expand Up @@ -154,23 +154,23 @@
- when: migration_velero
block:
- name: Check if cloud-credentials secret exists already so we don't update it
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ velero_aws_secret_name }}"
namespace: "{{ mig_namespace }}"
register: secret_status

- name: Check if gcp-cloud-credentials secret exists already so we don't update it
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ velero_gcp_secret_name }}"
namespace: "{{ mig_namespace }}"
register: gcp_secret_status

- name: Check if azure-cloud-credentials secret exists already so we don't update it
k8s_facts:
k8s_info:
api_version: v1
kind: Secret
name: "{{ velero_azure_secret_name }}"
Expand Down Expand Up @@ -240,7 +240,7 @@
- monitoring-rolebinding.yml.j2

- name: Check if mig ui route exists already so we don't update it
k8s_facts:
k8s_info:
api_version: "route.openshift.io/v1"
kind: Route
name: migration
Expand All @@ -260,7 +260,7 @@
- when: migration_ui
block:
- name: Find generated route
k8s_facts:
k8s_info:
api_version: "route.openshift.io/v1"
kind: "Route"
namespace: "{{ mig_namespace }}"
Expand All @@ -281,7 +281,7 @@
mig_ui_oauth_redirect_url: "https://{{ mig_ui_url }}/login/callback"

- name: Check if migration ui oauthclient secret exists already so we don't update it
k8s_facts:
k8s_info:
api_version: v1
kind: OAuthClient
name: migration
Expand Down Expand Up @@ -309,7 +309,7 @@
old_controller_detected: false

- name: "Get migration-controller deployment"
k8s_facts:
k8s_info:
api_version: apps/v1
kind: Deployment
name: migration-controller
Expand Down Expand Up @@ -379,7 +379,7 @@
definition: "{{ lookup('template', 'log_reader.yml.j2') }}"

- name: Check if discovery route exists
k8s_facts:
k8s_info:
api_version: "route.openshift.io/v1"
kind: Route
name: discovery
Expand All @@ -393,7 +393,7 @@
discovery_api_url: "https://{{discovery_route.resources[0].spec.host}}"

- name: Check if migration ui configmap exists already so we don't update it
k8s_facts:
k8s_info:
api_version: v1
kind: ConfigMap
name: "{{ mig_ui_configmap_name }}"
Expand Down Expand Up @@ -456,7 +456,7 @@
- when: not migration_controller
block:
- name: Find Controller ReplicaSets
k8s_facts:
k8s_info:
kind: ReplicaSet
namespace: "{{ mig_namespace }}"
label_selectors:
Expand All @@ -474,7 +474,7 @@
- when: not migration_ui
block:
- name: Find UI ReplicaSets
k8s_facts:
k8s_info:
kind: ReplicaSet
namespace: "{{ mig_namespace }}"
label_selectors:
Expand Down