Documentation ¶
Overview ¶
+k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/openshift/service-idler/pkg/apis/idling +k8s:defaulter-gen=TypeMeta +groupName=idling.openshift.io
Copyright 2018 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var ( // Define CRDs for resources IdlerCRD = v1beta1.CustomResourceDefinition{ ObjectMeta: metav1.ObjectMeta{ Name: "idlers.idling.openshift.io", }, Spec: v1beta1.CustomResourceDefinitionSpec{ Group: "idling.openshift.io", Version: "v1alpha2", Names: v1beta1.CustomResourceDefinitionNames{ Kind: "Idler", Plural: "idlers", }, Scope: "Namespaced", Validation: &v1beta1.CustomResourceValidation{ OpenAPIV3Schema: &v1beta1.JSONSchemaProps{ Type: "object", Properties: map[string]v1beta1.JSONSchemaProps{ "apiVersion": { Type: "string", }, "kind": { Type: "string", }, "metadata": { Type: "object", }, "spec": { Type: "object", Properties: map[string]v1beta1.JSONSchemaProps{ "targetScalables": { Type: "array", Items: &v1beta1.JSONSchemaPropsOrArray{ Schema: &v1beta1.JSONSchemaProps{ Type: "object", Properties: map[string]v1beta1.JSONSchemaProps{ "group": { Type: "string", }, "name": { Type: "string", }, "resource": { Type: "string", }, }, }, }, }, "triggerServiceNames": { Type: "array", Items: &v1beta1.JSONSchemaPropsOrArray{ Schema: &v1beta1.JSONSchemaProps{ Type: "string", }, }, }, "wantIdle": { Type: "boolean", }, }, }, "status": { Type: "object", Properties: map[string]v1beta1.JSONSchemaProps{ "idled": { Type: "boolean", }, "inactiveServiceNames": { Type: "array", Items: &v1beta1.JSONSchemaPropsOrArray{ Schema: &v1beta1.JSONSchemaProps{ Type: "string", }, }, }, "unidledScales": { Type: "array", Items: &v1beta1.JSONSchemaPropsOrArray{ Schema: &v1beta1.JSONSchemaProps{ Type: "object", Properties: map[string]v1beta1.JSONSchemaProps{ "previousScale": { Type: "integer", Format: "int32", }, }, }, }, }, }, }, }, }, }, }, } )
var SchemeGroupVersion = schema.GroupVersion{Group: "idling.openshift.io", Version: "v1alpha2"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type CrossGroupObjectReference ¶
type CrossGroupObjectReference struct { // Group is the API group that the given resource belongs to. Group string `json:"group"` // Resource is the type of resource that this references. Resource string `json:"resource"` // Name is the name of the object that we're referencing. Name string `json:"name"` }
CrossGroupObjectReference references an object in the same namespace as the current "context", but potentially in a different API group.
func (*CrossGroupObjectReference) DeepCopy ¶
func (in *CrossGroupObjectReference) DeepCopy() *CrossGroupObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossGroupObjectReference.
func (*CrossGroupObjectReference) DeepCopyInto ¶
func (in *CrossGroupObjectReference) DeepCopyInto(out *CrossGroupObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Idler ¶
type Idler struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec IdlerSpec `json:"spec,omitempty"` Status IdlerStatus `json:"status,omitempty"` }
Idler +k8s:openapi-gen=true +resource:path=idlers
func (*Idler) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Idler.
func (*Idler) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Idler) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IdlerList ¶
type IdlerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Idler `json:"items"` }
func (*IdlerList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdlerList.
func (*IdlerList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IdlerList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IdlerSpec ¶
type IdlerSpec struct { // WantIdle represents the desired state of idling WantIdle bool `json:"wantIdle"` // TargetScalables contains the collection of scalables that // are idled/unidled together. TargetScalables []CrossGroupObjectReference `json:"targetScalables,omitempty"` // TriggerServiceNames contains the collection of services that shold // trigger unidling. Their corresponding endpoints objects will be // used to determine whether or not unidling is successful. TriggerServiceNames []string `json:"triggerServiceNames,omitempty"` }
IdlerSpec defines the desired state of Idler
func (*IdlerSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdlerSpec.
func (*IdlerSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IdlerStatus ¶
type IdlerStatus struct { // Idled represents the current state of idling Idled bool `json:"idled"` // UnidleScales contains the previous scales of idled scalables UnidledScales []UnidleInfo `json:"unidledScales,omitempty"` // InactiveServiceNames contains services in the process of // unidling that have not yet become active. InactiveServiceNames []string `json:"inactiveServiceNames,omitempty"` }
IdlerStatus defines the observed state of Idler
func (*IdlerStatus) DeepCopy ¶
func (in *IdlerStatus) DeepCopy() *IdlerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdlerStatus.
func (*IdlerStatus) DeepCopyInto ¶
func (in *IdlerStatus) DeepCopyInto(out *IdlerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UnidleInfo ¶
type UnidleInfo struct { CrossGroupObjectReference `json:",inline"` // PreviousScale represents the replica count of this object before it // was idled. PreviousScale int32 `json:"previousScale"` }
UnidleInfo represents the information needed to restore an idled object to its unidled state.
func (*UnidleInfo) DeepCopy ¶
func (in *UnidleInfo) DeepCopy() *UnidleInfo
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnidleInfo.
func (*UnidleInfo) DeepCopyInto ¶
func (in *UnidleInfo) DeepCopyInto(out *UnidleInfo)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.