Documentation ¶
Index ¶
Constants ¶
View Source
const ( CRDVersionKey = "crd.solo.io/version" CRDSpecHashKey = "crd.solo.io/specHash" CRDMetadataKey = "crd.solo.io/crdMetadata" )
Chart provides the input data structure for generating Helm charts from the skv2 chart "meta-templates" (templates whose outputs are templates and other files used by generated Helm charts)
Variables ¶
This section is empty.
Functions ¶
func DoesCrdNeedUpgrade ¶
func DoesCrdNeedUpgrade(newProductVersion, newCrdHash string, deployedCrdAnnotations map[string]string) (bool, error)
*
- The idea behind this function is that we only want to ugprade a CRD if the version of the new CRD
- is higher than version of the CRD in the cluser **and** the specHash is different.
- The reasoning:
- if the spec hash is the same, then the CRD's json schema is the same, and it is pointless to upgrade it.
- if the spec hash is different, then we want to make sure we only update a CRD when it is backwards compatible.
- under the assumption that we don't make backwards incompatible changes, then this means that we
- should only upgrade a CRD if it's version is higher than what's deployed on the cluster.
Types ¶
type CRDAnnotations ¶
type CRDMetadata ¶
type CRDMetadata struct { CRDS []CRDAnnotations `json:"crds"` Version string `json:"version"` }
func ParseCRDMetadataFromAnnotations ¶
func ParseCRDMetadataFromAnnotations(annotations map[string]string) (*CRDMetadata, error)
type CrdNeedsUpgrade ¶
type CrdNeedsUpgrade struct {
CRDName string
}
func (*CrdNeedsUpgrade) Error ¶
func (e *CrdNeedsUpgrade) Error() string
type CrdNotFound ¶
type CrdNotFound struct {
CRDName string
}
func (*CrdNotFound) Error ¶
func (e *CrdNotFound) Error() string
type ErrMap ¶
func DoCrdsNeedUpgrade ¶
func DoCrdsNeedUpgrade(newProdCrdInfo CRDMetadata, deployedInClusterCrds []apiextv1.CustomResourceDefinition) ErrMap
Click to show internal directories.
Click to hide internal directories.