Skip to content

Commit

Permalink
change ansible k8s dep
Browse files Browse the repository at this point in the history
Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Oct 4, 2023
1 parent 97e7ba7 commit 2439d9d
Show file tree
Hide file tree
Showing 28 changed files with 78 additions and 88 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ci: all tidy vendor bazel-generate generate-verify
all: test forklift-controller

# Run tests
test: generate fmt vet manifests
test: manifests generate fmt vet
go test ./pkg/... ./cmd/... -coverprofile cover.out

# Experimental e2e target
Expand All @@ -108,15 +108,15 @@ e2e-sanity-openstack-extended:


# Build forklift-controller binary
forklift-controller: generate fmt vet
forklift-controller: manifests generate fmt vet
go build -o bin/forklift-controller github.com/konveyor/forklift-controller/cmd/forklift-controller

# Build manager binary with compiler optimizations disabled
debug: generate fmt vet
debug: manifests generate fmt vet
go build -o bin/forklift-controller -gcflags=all="-N -l" github.com/konveyor/forklift-controller/cmd/forklift-controller

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet
run: manifests generate fmt vet
export METRICS_PORT=8888;\
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1 go run ./cmd/forklift-controller/main.go

Expand Down
6 changes: 4 additions & 2 deletions operator/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ namespace: forklift-operator-system
namePrefix: ""

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
#labels:
#- includeSelectors: true
# pairs:
# someName: someValue

resources:
- ../crd
Expand Down
2 changes: 1 addition & 1 deletion operator/config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
# capabilities:
# drop:
# - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
Expand Down
6 changes: 6 additions & 0 deletions operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ kind: ClusterRole
metadata:
name: manager-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- watch
- apiGroups:
- config.openshift.io
resources:
Expand Down
6 changes: 4 additions & 2 deletions operator/config/testing/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ namespace: osdk-test
namePrefix: osdk-

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue
#labels:
#- includeSelectors: true
# pairs:
# someName: someValue

patchesStrategicMerge:
- manager_image.yaml
Expand Down
2 changes: 1 addition & 1 deletion operator/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

tasks:
- name: Create Namespace
k8s:
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: '{{ namespace }}'
Expand Down
2 changes: 1 addition & 1 deletion operator/molecule/default/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
state: absent

- name: Destroy Namespace
k8s:
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: '{{ namespace }}'
Expand Down
4 changes: 2 additions & 2 deletions operator/molecule/default/kustomize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
changed_when: false

- name: Set resources to {{ state }}
k8s:
kubernetes.core.k8s:
definition: '{{ item }}'
state: '{{ state }}'
wait: no
loop: '{{ resources.stdout | from_yaml_all | list }}'

- name: Wait for resources to get to {{ state }}
k8s:
kubernetes.core.k8s:
definition: '{{ item }}'
state: '{{ state }}'
wait: yes
Expand Down
9 changes: 0 additions & 9 deletions operator/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ dependency:
name: galaxy
driver:
name: delegated
lint: |
set -e
yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" .
platforms:
- name: cluster
groups:
- k8s
provisioner:
name: ansible
lint: |
set -e
ansible-lint
inventory:
group_vars:
all:
Expand All @@ -31,6 +25,3 @@ provisioner:
K8S_AUTH_KUBECONFIG: ${KUBECONFIG:-"~/.kube/config"}
verifier:
name: ansible
lint: |
set -e
ansible-lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Create the forklift.konveyor.io/v1beta1.ForkliftController
k8s:
kubernetes.core.k8s:
state: present
namespace: '{{ namespace }}'
definition: "{{ lookup('template', '/'.join([samples_dir, cr_file])) | from_yaml }}"
Expand Down
9 changes: 0 additions & 9 deletions operator/molecule/kind/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ dependency:
name: galaxy
driver:
name: delegated
lint: |
set -e
yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" .
platforms:
- name: cluster
groups:
Expand All @@ -15,9 +12,6 @@ provisioner:
playbooks:
prepare: ../default/prepare.yml
verify: ../default/verify.yml
lint: |
set -e
ansible-lint
inventory:
group_vars:
all:
Expand All @@ -37,6 +31,3 @@ provisioner:
KUBECONFIG: ${MOLECULE_EPHEMERAL_DIRECTORY}/kubeconfig
verifier:
name: ansible
lint: |
set -e
ansible-lint
8 changes: 3 additions & 5 deletions operator/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
collections:
- name: community.kubernetes
version: "2.0.1"
- name: operator_sdk.util
version: "0.4.0"
version: "0.5.0"
- name: kubernetes.core
version: "2.3.1"
version: "2.4.0"
- name: cloud.common
version: "2.1.1"
version: "2.1.4"
4 changes: 2 additions & 2 deletions operator/roles/forkliftcontroller/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ galaxy_info:
platforms:
- name: EL
versions:
- 8
- 9

galaxy_tags:
- forklift
Expand All @@ -28,4 +28,4 @@ galaxy_info:
dependencies: []
collections:
- operator_sdk.util
- community.kubernetes
- kubernetes.core
4 changes: 2 additions & 2 deletions operator/roles/forkliftcontroller/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
- block:

- name: "Get {{ resource_kind }} resources labeled {{ feature_label }}"
k8s_info:
kubernetes.core.k8s_info:
namespace: "{{ app_namespace }}"
kind: "{{ resource_kind }}"
label_selectors:
- "service = {{ feature_label }}"
register: results

- name: "Clean up {{ resource_kind }} resources labeled {{ feature_label }}"
k8s:
kubernetes.core.k8s:
namespace: "{{ app_namespace }}"
kind: "{{ results.resources[0].kind }}"
name: "{{ results.resources[0].metadata.name }}"
Expand Down
Loading

0 comments on commit 2439d9d

Please sign in to comment.