Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Level 0 - Initialize a new operator project

Check tools version and OCP access

The following instructions have been tested using:

$ go version
go version go1.22.3 linux/amd64
$ operator-sdk version
operator-sdk version: "v1.34.2", commit: "81dd3cb24b8744de03d312c1ba23bfc617044005", kubernetes version: "1.28.0", go version: "go1.21.10", GOOS: "linux", GOARCH: "amd64"
$ oc version
Client Version: 4.15.17
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: 4.14.27
Kubernetes Version: v1.27.13+048520e
$ oc status
In project default on server https://api.exe-workshop-workshopdevconf1-pool-4ppbp.coreostrain.me:6443

svc/openshift - kubernetes.default.svc.cluster.local
svc/kubernetes - 172.30.0.1:443 -> 6443

View details with 'oc describe <resource>/<name>' or list resources with 'oc get all'.

Clone this repository

Clone the workshop's repository to get easy access to instructions, snippets and patches:

$ echo "export WORKSHOP_REPO=~/workshop_repo" >> ~/.bashrc
$ . ~/.bashrc
$ git clone https://github.com/opdev/devconf-operator.git ${WORKSHOP_REPO}

Prepare local folder

Create a new directory for your project and initialize a local git repository:

$ mkdir ~/devconf-operator && cd ~/devconf-operator
$ git init
Initialized empty Git repository in /home/ec2-user/devconf-operator/.git/

Initialize a new Go Operator project

Scaffold a new go operator project using operator-sdk

$ operator-sdk init --domain opdev.com --repo github.com/opdev/devconf-operator

Patch scaffolded project

The current version of operator-sdk is configured to install controller-gen in v.13.0, that has some known issues.

To workaround that, let's patch the Makefile with:

$ patch < ${WORKSHOP_REPO}/workshop/level_0/patches/0001-controller-gen-version.patch