Skip to content

Commit

Permalink
Merge pull request #12 from RedHatInsights/ver_0.38.0
Browse files Browse the repository at this point in the history
Update types for strimzi v0.38.0
  • Loading branch information
bsquizz authored Jan 21, 2025
2 parents 2970025 + c381a2b commit 37384bb
Show file tree
Hide file tree
Showing 17 changed files with 19,012 additions and 13,994 deletions.
109 changes: 109 additions & 0 deletions apis/core.strimzi.io/v1beta2/StrimziPodSet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// Code partially generated by github.com/atombender/go-jsonschema

package v1beta2

import (
"encoding/json"
"fmt"

v1 "k8s.io/api/core/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// manual type changes were made to StrimziPodSetSpec below after running crd-codegen

// The specification of the StrimziPodSet.
type StrimziPodSetSpec struct {
// The Pods managed by this StrimziPodSet.
Pods []v1.Pod `json:"pods" yaml:"pods" mapstructure:"pods"`

// Selector is a label query which matches all the pods managed by this
// `StrimziPodSet`. Only `matchLabels` is supported. If `matchExpressions` is set,
// it will be ignored.
Selector metav1.LabelSelector `json:"selector" yaml:"selector" mapstructure:"selector"`
}

// UnmarshalJSON implements json.Unmarshaler.
func (j *StrimziPodSetSpec) UnmarshalJSON(b []byte) error {
var raw map[string]interface{}
if err := json.Unmarshal(b, &raw); err != nil {
return err
}
if v, ok := raw["pods"]; !ok || v == nil {
return fmt.Errorf("field pods in StrimziPodSetSpec: required")
}
if v, ok := raw["selector"]; !ok || v == nil {
return fmt.Errorf("field selector in StrimziPodSetSpec: required")
}
type Plain StrimziPodSetSpec
var plain Plain
if err := json.Unmarshal(b, &plain); err != nil {
return err
}
*j = StrimziPodSetSpec(plain)
return nil
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// StrimziPodSet
type StrimziPodSet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// The specification of the StrimziPodSet.
Spec *StrimziPodSetSpec `json:"spec,omitempty" yaml:"spec,omitempty" mapstructure:"spec,omitempty"`

// The status of the StrimziPodSet.
Status *StrimziPodSetStatus `json:"status,omitempty" yaml:"status,omitempty" mapstructure:"status,omitempty"`
}

// +kubebuilder:object:root=true
// StrimziPodSetList contains a list of instances.
type StrimziPodSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`

// A list of StrimziPodSet objects.
Items []StrimziPodSet `json:"items,omitempty"`
}

// The status of the StrimziPodSet.
type StrimziPodSetStatus struct {
// List of status conditions.
Conditions []StrimziPodSetStatusConditionsElem `json:"conditions,omitempty" yaml:"conditions,omitempty" mapstructure:"conditions,omitempty"`

// Number of pods managed by this `StrimziPodSet` resource that have the current
// revision.
CurrentPods *int32 `json:"currentPods,omitempty" yaml:"currentPods,omitempty" mapstructure:"currentPods,omitempty"`

// The generation of the CRD that was last reconciled by the operator.
ObservedGeneration *int32 `json:"observedGeneration,omitempty" yaml:"observedGeneration,omitempty" mapstructure:"observedGeneration,omitempty"`

// Number of pods managed by this `StrimziPodSet` resource.
Pods *int32 `json:"pods,omitempty" yaml:"pods,omitempty" mapstructure:"pods,omitempty"`

// Number of pods managed by this `StrimziPodSet` resource that are ready.
ReadyPods *int32 `json:"readyPods,omitempty" yaml:"readyPods,omitempty" mapstructure:"readyPods,omitempty"`
}

type StrimziPodSetStatusConditionsElem struct {
// Last time the condition of a type changed from one status to another. The
// required format is 'yyyy-MM-ddTHH:mm:ssZ', in the UTC time zone.
LastTransitionTime *string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty" mapstructure:"lastTransitionTime,omitempty"`

// Human-readable message indicating details about the condition's last
// transition.
Message *string `json:"message,omitempty" yaml:"message,omitempty" mapstructure:"message,omitempty"`

// The reason for the condition's last transition (a single word in CamelCase).
Reason *string `json:"reason,omitempty" yaml:"reason,omitempty" mapstructure:"reason,omitempty"`

// The status of the condition, either True, False or Unknown.
Status *string `json:"status,omitempty" yaml:"status,omitempty" mapstructure:"status,omitempty"`

// The unique identifier of a condition, used to distinguish between other
// conditions in the resource.
Type *string `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"`
}
40 changes: 40 additions & 0 deletions apis/core.strimzi.io/v1beta2/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
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.
*/

// Package v1beta1 contains API Schema definitions for the kafka.strimzi.io v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=kafka.strimzi.io
package v1beta2

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "core.strimzi.io", Version: "v1beta2"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

func init() {
SchemeBuilder.Register(&StrimziPodSet{}, &StrimziPodSetList{})
}
183 changes: 183 additions & 0 deletions apis/core.strimzi.io/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37384bb

Please sign in to comment.