addon-metadata-operator

module
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: Apache-2.0

README

addon-metadata-operator

Operator responsible for managing AddOn resources in OSD

Developer Guide

Getting Started

The initial scaffolding is done using kubebuilder which doesn't work with go1.17. Here is how to download and setup go1.16 for this project:

# https://golang.org/doc/manage-install#installing-multiple
$ go install golang.org/dl/go1.16.7@latest
$ go1.16.7 download

$ cat <<EOF > .envrc
export GOROOT=$(go1.16.7 env GOROOT)
export PATH=${GOROOT}/bin:${PATH}
EOF

$ direnv allow .
.envrc

Use .envrc with direnv to make sure your environment is set properly:

export GOROOT=$(go1.16.7 env GOROOT)
export GOBIN=${PWD}/.cache/bin
export PATH=${GOROOT}/bin:${GOBIN}:${PATH}
export KUBECONFIG=${PWD}/.cache/kubeconfig

Develop

Useful make commands

Install pre-commit hooks:

$ pre-commit install

Run code checks:

$ make check

Run tests:

$ make test

Regenerate manifests and CRDs (./config/crd/bases/addons.managed.openshift.io_addonmetadata.yaml whenever you modify the AddonMetadata type:

$ make manifest

You can also use the Dockerfile.test for a more stable environment:

$ ./pr_check.sh

Release

mtcli

The external Jenkins integration will run the build_tag.sh script after you push a tag. The script runs goreleaser, which is responsible for building the binaries and publishing them as a Github Release.

$ git tag vX.X.X
$ git push upstream --tags

A tag can't be built twice, you will need to add a new commit and a new tag referencing the latest commit.

addon-metadata-operator image

The container image is built on every merge to the master branch. The external Jenkins integration will run the build_deploy.sh script, effectively building and pushing to: https://quay.io/repository/app-sre/addon-metadata-operator.

License

Apache License 2.0, see LICENSE.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the addons v1alpha1 API group +kubebuilder:object:generate=true +groupName=addons.managed.openshift.io
Package v1alpha1 contains API Schema definitions for the addons v1alpha1 API group +kubebuilder:object:generate=true +groupName=addons.managed.openshift.io
cmd
internal
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL