Skip to content

Commit

Permalink
Adapt testpmd-lb-operator to operator-sdk v1.33.0 (#53)
Browse files Browse the repository at this point in the history
* Adapt testpmd-lb-operator to operator-sdk v1.33.0

* Use old Makefile

* Use new Makefile format

* Update README

* Fix version in makefile
  • Loading branch information
ramperher authored Feb 14, 2024
1 parent 0ddfda3 commit 630c609
Show file tree
Hide file tree
Showing 51 changed files with 489 additions and 169 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,45 @@ It is providing the following operators:

You can use them from the [Example CNF Catalog](https://quay.io/repository/rh-nfv-int/nfv-example-cnf-catalog?tab=tags).

How operators are created
------------------------

The four operators defined in this repository are built with [Operator SDK tool](https://sdk.operatorframework.io/docs/building-operators/).

We can differentiate between these two cases:

**Ansible-based operators:**

This is the case of testpmd-operator, trex-operator and testpmd-lb-operator.

Base structure for each case is achieved with the following commands, then it's just a matter of accommodating the required code for each operator in the corresponding files and folders:

- testpmd-operator

TBD

- trex-operator

TBD

- testpmd-lb-operator

```
$ mkdir testpmd-lb-operator; cd testpmd-lb-operator
$ operator-sdk init --domain openshift.io --plugins ansible
$ operator-sdk create api --version v1 --generate-role --group examplecnf --kind LoadBalancer
```

**Go-based operators:**

This is the case of cnf-app-mac-operator.

Base structure for this case is achieved with the following commands, then it's just a matter of accommodating the required code for the operator in the corresponding files and folders:

- cnf-app-mac-operator

TBD

Ansible based automation
------------------------

Expand Down
17 changes: 16 additions & 1 deletion testpmd-lb-operator/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
_cache

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin

# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~

# custom
_cache
*.patch
*sync.sh
build.sh
Expand Down
6 changes: 5 additions & 1 deletion testpmd-lb-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file.

## [Unreleased] -

## [0.2.13] - 2023-01-12
## [0.2.14] - 2024-02-07

- Changed skeleton, based on operator-sdk v1.33.0

## [0.2.13] - 2024-01-12

- Lifecycle webserver included in container images consumed from testpmd-container-app to cover CNF Certification requirements for liveness, readiness and startup probes

Expand Down
19 changes: 7 additions & 12 deletions testpmd-lb-operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
FROM quay.io/operator-framework/ansible-operator:v1.10.0
FROM quay.io/operator-framework/ansible-operator:v1.33.0

MAINTAINER skramaja@redhat.com
MAINTAINER telcoci@redhat.com

LABEL name="NFV Example CNF LB Operator" \
maintainer="skramaja@redhat.com" \
maintainer="telcoci@redhat.com" \
vendor="fredco" \
version="v0.2.3" \
release="v0.2.3" \
summary="An example CNF for platform valiation" \
description="An example CNF for platform valiation"
version="v0.2.14" \
release="v0.2.14" \
summary="An example CNF for platform validation" \
description="An example CNF for platform validation"

COPY licenses /licenses

USER root
RUN yum -y update-minimal --setopt=tsflags=nodocs \
--security --sec-severity=Important --sec-severity=Critical
USER ansible

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

0 comments on commit 630c609

Please sign in to comment.