Documentation ¶
Overview ¶
Package models contains a collection of structs that represent Kubernetes resources
Index ¶
- func KustomizeFromYAMLPath(path string) (kustomizationAPITypes.Kustomization, error)
- func NewKomponent(resources []string) kustomizationAPITypes.Kustomization
- func NewKustomization(resources []string, components []string, namespace string) kustomizationAPITypes.Kustomization
- func SortKustomization(kustom kustomizationAPITypes.Kustomization) kustomizationAPITypes.Kustomization
- func ToYAML(resource interface{}) ([]byte, error)
- type CustomResourceQuota
- type Group
- type Metadata
- type Namespace
- type OnboardNamespace
- type OnboardingRequest
- type OperatorGroup
- type OperatorGroupSpec
- type Resource
- type ResourceQuota
- type ResourceQuotaSpec
- type RoleBinding
- type Subject
- type Subscription
- type SubscriptionSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KustomizeFromYAMLPath ¶
func KustomizeFromYAMLPath(path string) (kustomizationAPITypes.Kustomization, error)
KustomizeFromYAMLPath reads the file at path and returns a Kustomization object.
func NewKomponent ¶
func NewKomponent(resources []string) kustomizationAPITypes.Kustomization
NewKomponent creates a new Komponent object.
func NewKustomization ¶
func NewKustomization(resources []string, components []string, namespace string) kustomizationAPITypes.Kustomization
func SortKustomization ¶ added in v0.3.0
func SortKustomization(kustom kustomizationAPITypes.Kustomization) kustomizationAPITypes.Kustomization
Types ¶
type CustomResourceQuota ¶ added in v0.3.0
type CustomResourceQuota struct { LimitsCPU string `yaml:"limits.cpu,omitempty"` LimitsMemory string `yaml:"limits.memory,omitempty"` Buckets int `yaml:"count/objectbucketclaims.objectbucket.io,omitempty"` RequestsCPU string `yaml:"requests.cpu,omitempty"` RequestsMemory string `yaml:"requests.memory,omitempty"` RequestsStorage string `yaml:"requests.storage,omitempty"` }
type Metadata ¶
type Metadata struct { Name string Annotations kvmap `yaml:",omitempty"` Labels kvmap `yaml:",omitempty"` }
Metadata represents the metadata section of a Kubernetes resource.
type Namespace ¶
type Namespace struct {
Resource `yaml:",inline"`
}
Namespace represents a Kubernetes Namespace.
func NewNamespace ¶
NewNamespace creates a new Namespace object. The object's metadata.name is set to the value of the "name" parameter. The "owner" and "displayName" parameters are used to initialize the "openshift.io/requester" and ""openshift.io/display-name" annotations.
type OnboardNamespace ¶ added in v0.3.0
type OnboardingRequest ¶ added in v0.3.0
type OnboardingRequest struct { Env string `yaml:",omitempty"` Namespaces []OnboardNamespace ProjectDescription string `yaml:"project_description"` TargetCluster string `yaml:"target_cluster"` TeamName string `yaml:"team_name"` Users []string `yaml:",omitempty"` }
func OnboardRequestFromYAMLPath ¶ added in v0.3.0
func OnboardRequestFromYAMLPath(path string) (OnboardingRequest, error)
type OperatorGroup ¶
type OperatorGroup struct { Resource `yaml:",inline"` Spec OperatorGroupSpec }
OperatorGroup represents a Kubernetes OLM OperatorGroup resource.
func NewOperatorGroup ¶
func NewOperatorGroup(namespace string, singleNamespace bool) OperatorGroup
NewOperatorGroup creates a new OperatorGroup object. The object's metadata.name is set to the value of the "namespace" parameter. If the "singleNamespace" is true, spec.targetNamespaces is set to include the "namespace" string
type OperatorGroupSpec ¶
type OperatorGroupSpec struct {
TargetNamespaces []string `yaml:"targetNamespaces,omitempty"`
}
type Resource ¶
type Resource struct { APIVersion string `yaml:"apiVersion"` Kind string Metadata Metadata `yaml:",omitempty"` }
Resource represents the core attributes of a Kubernetes resource. This struct is embedded in all other Kubernetes resource models.
type ResourceQuota ¶ added in v0.3.0
type ResourceQuota struct { APIVersion string `yaml:"apiVersion"` Kind string Metadata Metadata Spec ResourceQuotaSpec }
func NewCustomResourceQuota ¶ added in v0.3.0
func NewCustomResourceQuota(namespace string, customResourceQuota CustomResourceQuota) ResourceQuota
type ResourceQuotaSpec ¶ added in v0.3.0
type ResourceQuotaSpec struct {
Hard CustomResourceQuota
}
type RoleBinding ¶
type RoleBinding struct { Resource `yaml:",inline"` RoleRef Subject `yaml:"roleRef"` Subjects []Subject }
RoleBinding represents a Kubernetes RoleBinding object. It links one or more subjects to a role.
func NewRoleBinding ¶
func NewRoleBinding(name string, role string) RoleBinding
NewRoleBinding creates a new RoleBinding object. The "name" parameter is used to initialize "metadata.name". The "role" parameter is used to set the name of the "roleRef".
func (*RoleBinding) AddGroup ¶
func (rolebinding *RoleBinding) AddGroup(groupName string)
AddGroup adds an entry for the named Group to the list of subjects in the RoleBinding.
type Subject ¶
Subject represents a participant in a RoleBinding.
func NewGroupSubject ¶
NewGroupSubject creates a new Subject referring to the named group.
type Subscription ¶
type Subscription struct { Resource `yaml:",inline"` Spec SubscriptionSpec }
Subscription represents a Kubernetes OLM Subscription resource.
func NewSubscription ¶
func NewSubscription(name, catalog, channel, strategy string) Subscription
NewSubscription creates a new Subscription object. The object's metadata.name is set to the value of the "name" parameter. The "catalog" parameter defines spec.source. The "strategy" parameter is allowed to be either Automatic or Manual and initialized spec.installPlanApproval. Optional "channel" parameters sets spec.channel