GithubHelp home page GithubHelp logo

isabella232 / operator-curator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openshift/operator-curator

0.0 0.0 0.0 60 KB

Curate operators published to certain source repositories, based in a set of rules

License: Apache License 2.0

Python 96.95% Shell 0.80% Dockerfile 2.25%

operator-curator's Introduction

appregistry curator

The app registry curator is a tool that scans Quay.io app registries in order to vet operators for use with OSD v4.

Requirements

The curator is a single python script that requires:

  • requests
  • PyYAML

Credentials

In order to use this script, you'll need basic auth credentials for the Quay CNR API as well as an oauth token the Quay repository API. The basic auth token is required to push packages to the app registry, and the oauth token is required to make new packages publicly visible.

Getting a basic auth token

The included script 'get-quay-token' will prompt for your Quay.io username and password and will return a basic auth token in this format:

{"token":"basic abcdefghi123456=="}

Getting an oauth token

Navigate to quay.io/repository and select an organization to create a token under (eg. curated-redhat-operators). Select the "Applications" tab on the left, and then click the button "+ Create New Application". Enter a name for your application (e.g. "appregistry-curator") and hit enter. Click on the application name that appears. Select the "Generate Token" tab on the left. Click the "Administer Repositories" checkbox, then click "Generate Access Token". Copy down the generated access token

Access Token: ZaaaAAAinsertvalidoauthtokenhereAAAaaaaz

This token will work across all organizations that your user has access to.

Usage

You can launch the curator by providing it the credentials you just gathered:

./curator.py --app-token "basic abcdefghi123456==" --oauth-token "ZaaaAAAinsertvalidoauthtokenhereAAAaaaaz"

Alternatively, you can run the curator in a container:

docker build -t operator-curator .

docker run operator-curator --app-token "basic abcdefghi123456==" --oauth-token "ZaaaAAAinsertvalidoauthtokenhereAAAaaaaz"

Details

Currently, the script scans through every package on 3 app registry namespaces:

  • redhat-operators
  • certified-operators
  • community-operators

It downloads and evaluates each version of each package in these registries. Currently an operator is deemed invalid for use with OSD v4 if:

  • the package has no "bundle.yaml" file present
  • the install spec requires "clusterPermissions"
  • the install spec requires the use of SCCs
  • the installMode spec supports "MultiNamespace"
  • the package is in our blacklist.

An otherwise invalid operator can be added to the whitelist to have it be approved. Currently this whitelist includes "cluster-logging" and "elasticsearch-operator".

Operators that are deemed valid are then uploaded to their curated registry. Currently, the curated registries are:

  • curated-redhat-operators
  • curated-certified-operators
  • curated-community-operators

Running Unit Tests By Hand

Running unit tests by hand is just a matter of running:

# Python3 if python --version is not 3
python3 -m unittest test_curator.py

# otherwise:
python -m unittest test_curator.py

Linting

Python linting can be done using Pylint. Note that this isn't currently completely passing the linter tests.

# Install pylint if it's not already
pip3 install --user pylint

pylint curator.py
pylint test_curator.py

operator-curator's People

Contributors

clcollins avatar csheremeta avatar jewzaam avatar robotmaxtron avatar rogbas avatar thrasher-redhat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.