api

package
v0.0.0-...-0284ff5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Type         ChangeType
	Group        string
	Resource     string
	VersionsFrom []string
	VersionsTo   []string
}

Change represents a single change between 2 APIMaps for a given resource.

func Report

func Report(from, to *Map) ([]Change, error)

Report takes 2 mapped k8s APIs and builds a list of changes for each group, resource and version. The report can be represented in various formats for either human or machine consumption. How to present a change:

	 group/res       From          change             To
  --------------------------------------------------------------------
  - group/
      resource:    NONE          added              versionA
      resource:    versionA      modified           versionB (or VersionA,VersionB)
      resource:    versionA      removed            NONE

type ChangeType

type ChangeType string

ChangeType is an enummeration of all the possible kinds of changes between 2 APIs.

const (
	Addition     ChangeType = "added"
	Removal      ChangeType = "removed"
	Modification ChangeType = "modified"
)

type Map

type Map struct {
	Groups map[string]Resources
}

Map contains kubernetes API information in a set of maps for efficient access, comparison and output. The structure is a root map containing the groups, then each group has a map of resources. Finally, each resource contains a set of versions it supports

type Resources

type Resources map[string]Versions

Resources is a map where each key is one resource and the value is the set of versions it supports. Example { "Pod": ["v1alpha2", "v1"] }

type Versions

type Versions []string

Versions is a list of versions (e.g. ["v1", "v2beta1"])

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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