offlinecheck

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright (C) 2020-2023 Red Hat, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2020-2023 Red Hat, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2020-2023 Red Hat, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright (C) 2020-2022 Red Hat, Inc.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Index

Constants

View Source
const (
	CSVNAMELENGTH = 2
)

Variables

This section is empty.

Functions

func CompareVersion

func CompareVersion(version, constraint string) bool

CompareVersion compare between versions

func ExtractNameVersionFromName

func ExtractNameVersionFromName(operatorName string) (name, version string)

func LoadBinary

func LoadBinary(bytes []byte, db map[string]*ContainerCatalogEntry) (entries int, err error)

func LoadCatalogs

func LoadCatalogs(offlineDBPath string) error

func LoadHelmCharts

func LoadHelmCharts(charts ChartStruct)

Types

type ChartEntry

type ChartEntry struct {
	Name                  string `yaml:"name"`
	ChartVersion          string `yaml:"version"`
	KubeVersionConstraint string `yaml:"kubeVersion"`
}

type ChartStruct

type ChartStruct struct {
	Entries map[string][]ChartEntry `yaml:"entries"`
}

type ContainerCatalogEntry

type ContainerCatalogEntry struct {
	ID                string       `json:"_id"`
	Architecture      string       `json:"architecture"`
	Certified         bool         `json:"certified"`
	DockerImageDigest string       `json:"image_id"`
	Repositories      []Repository `json:"repositories"`
}

type ContainerPageCatalog

type ContainerPageCatalog struct {
	Page     uint                    `json:"page"`
	PageSize uint                    `json:"page_size"`
	Total    uint                    `json:"total"`
	Data     []ContainerCatalogEntry `json:"data"`
}

type OfflineValidator

type OfflineValidator struct{}

func (OfflineValidator) IsContainerCertified

func (validator OfflineValidator) IsContainerCertified(registry, repository, tag, digest string) bool

func (OfflineValidator) IsHelmChartCertified

func (validator OfflineValidator) IsHelmChartCertified(helm *release.Release, ourKubeVersion string) bool

func (OfflineValidator) IsOperatorCertified

func (validator OfflineValidator) IsOperatorCertified(csvName, ocpVersion, channel string) bool

isOperatorCertified check the presence of operator name in certified operators db the operator name is the csv ocpVersion is Major.Minor OCP version

type OperatorCatalog

type OperatorCatalog struct {
	Page     uint           `json:"page"`
	PageSize uint           `json:"page_size"`
	Total    uint           `json:"total"`
	Data     []OperatorData `json:"data"`
	NodeName string         `json:"nodeName"`
}

type OperatorData

type OperatorData struct {
	CsvName    string `json:"csv_name"`
	OcpVersion string `json:"ocp_version"`
	Channel    string `json:"channel_name"`
}

type OperatorOcpVersionMatch

type OperatorOcpVersionMatch struct {
	// contains filtered or unexported fields
}

type Repository

type Repository struct {
	Registry      string `json:"registry"`
	Repository    string `json:"repository"`
	Tags          []Tag  `json:"tags"`
	PublishedDate string `json:"push_date"`
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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