diff --git a/apis/apikeys/v1alpha1/apikey_type.go b/apis/apikeys/v1alpha1/apikey_type.go index 68cb5f2d4c6..ae5b02b17cf 100644 --- a/apis/apikeys/v1alpha1/apikey_type.go +++ b/apis/apikeys/v1alpha1/apikey_type.go @@ -41,7 +41,7 @@ var ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=gcp,shortName=gcpapikeyskey;gcpapikeyskeys // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/directcrd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=alpha";"cnrm.cloud.google.com/system=true" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/tf2crd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=alpha";"cnrm.cloud.google.com/system=true" // +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" // +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" // +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" diff --git a/apis/resources/logging/v1beta1/logmetric_types.go b/apis/resources/logging/v1beta1/logmetric_types.go index 728ab0a2e2d..51b6b58e1c8 100644 --- a/apis/resources/logging/v1beta1/logmetric_types.go +++ b/apis/resources/logging/v1beta1/logmetric_types.go @@ -233,7 +233,7 @@ type LoggingLogMetricStatus struct { // +kubebuilder:subresource:status // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/directcrd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/system=true" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/system=true" // +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" // +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" // +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_apikeyskeys.apikeys.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_apikeyskeys.apikeys.cnrm.cloud.google.com.yaml index 75ae5e821a1..1269a475084 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_apikeyskeys.apikeys.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_apikeyskeys.apikeys.cnrm.cloud.google.com.yaml @@ -5,10 +5,10 @@ metadata: cnrm.cloud.google.com/version: 0.0.0-dev creationTimestamp: null labels: - cnrm.cloud.google.com/directcrd: "true" cnrm.cloud.google.com/managed-by-kcc: "true" cnrm.cloud.google.com/stability-level: alpha cnrm.cloud.google.com/system: "true" + cnrm.cloud.google.com/tf2crd: "true" name: apikeyskeys.apikeys.cnrm.cloud.google.com spec: group: apikeys.cnrm.cloud.google.com diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_logginglogmetrics.logging.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_logginglogmetrics.logging.cnrm.cloud.google.com.yaml index 5c10a286590..9bcb20de6ee 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_logginglogmetrics.logging.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_logginglogmetrics.logging.cnrm.cloud.google.com.yaml @@ -5,7 +5,6 @@ metadata: cnrm.cloud.google.com/version: 0.0.0-dev creationTimestamp: null labels: - cnrm.cloud.google.com/directcrd: "true" cnrm.cloud.google.com/managed-by-kcc: "true" cnrm.cloud.google.com/stability-level: stable cnrm.cloud.google.com/system: "true" diff --git a/experiments/compositions/composition/proto/expander.pb.go b/experiments/compositions/composition/proto/expander.pb.go index 10ca89b6618..a7649d836c9 100644 --- a/experiments/compositions/composition/proto/expander.pb.go +++ b/experiments/compositions/composition/proto/expander.pb.go @@ -23,10 +23,11 @@ package expander import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/experiments/compositions/composition/proto/expander_grpc.pb.go b/experiments/compositions/composition/proto/expander_grpc.pb.go index 3f0e972f108..33f94c0370f 100644 --- a/experiments/compositions/composition/proto/expander_grpc.pb.go +++ b/experiments/compositions/composition/proto/expander_grpc.pb.go @@ -24,6 +24,7 @@ package expander import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/pkg/clients/generated/apis/apikeys/v1alpha1/apikeyskey_types.go b/pkg/clients/generated/apis/apikeys/v1alpha1/apikeyskey_types.go index 021abe09157..a96c760f993 100644 --- a/pkg/clients/generated/apis/apikeys/v1alpha1/apikeyskey_types.go +++ b/pkg/clients/generated/apis/apikeys/v1alpha1/apikeyskey_types.go @@ -134,7 +134,7 @@ type APIKeysKeyStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=gcp,shortName=gcpapikeyskey;gcpapikeyskeys // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/directcrd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=alpha";"cnrm.cloud.google.com/system=true" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=alpha";"cnrm.cloud.google.com/system=true";"cnrm.cloud.google.com/tf2crd=true" // +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" // +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" // +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" diff --git a/pkg/clients/generated/apis/cloudbuild/v1beta1/cloudbuildworkerpool_types.go b/pkg/clients/generated/apis/cloudbuild/v1beta1/cloudbuildworkerpool_types.go index 179437745a6..dc533bc0ab0 100644 --- a/pkg/clients/generated/apis/cloudbuild/v1beta1/cloudbuildworkerpool_types.go +++ b/pkg/clients/generated/apis/cloudbuild/v1beta1/cloudbuildworkerpool_types.go @@ -81,6 +81,32 @@ type CloudBuildWorkerPoolSpec struct { ResourceID *string `json:"resourceID,omitempty"` } +type WorkerpoolNetworkConfigStatus struct { + // +optional + EgressOption *string `json:"egressOption,omitempty"` + + // +optional + PeeredNetwork *string `json:"peeredNetwork,omitempty"` + + // +optional + PeeredNetworkIpRange *string `json:"peeredNetworkIpRange,omitempty"` +} + +type WorkerpoolObservedStateStatus struct { + // +optional + NetworkConfig *WorkerpoolNetworkConfigStatus `json:"networkConfig,omitempty"` + + WorkerConfig WorkerpoolWorkerConfigStatus `json:"workerConfig"` +} + +type WorkerpoolWorkerConfigStatus struct { + // +optional + DiskSizeGb *int64 `json:"diskSizeGb,omitempty"` + + // +optional + MachineType *string `json:"machineType,omitempty"` +} + type CloudBuildWorkerPoolStatus struct { /* Conditions represent the latest available observations of the CloudBuildWorkerPool's current state. */ @@ -93,6 +119,10 @@ type CloudBuildWorkerPoolStatus struct { // +optional ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + /* ObservedState is the state of the resource as most recently observed in GCP. */ + // +optional + ObservedState *WorkerpoolObservedStateStatus `json:"observedState,omitempty"` + // +optional ResourceID *string `json:"resourceID,omitempty"` @@ -105,7 +135,7 @@ type CloudBuildWorkerPoolStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=,shortName= // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=beta" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/directcrd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=beta" // CloudBuildWorkerPool is the Schema for the cloudbuild API // +k8s:openapi-gen=true diff --git a/pkg/clients/generated/apis/cloudbuild/v1beta1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/cloudbuild/v1beta1/zz_generated.deepcopy.go index 76670212b7d..eb0e29ac804 100644 --- a/pkg/clients/generated/apis/cloudbuild/v1beta1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/cloudbuild/v1beta1/zz_generated.deepcopy.go @@ -361,6 +361,11 @@ func (in *CloudBuildWorkerPoolStatus) DeepCopyInto(out *CloudBuildWorkerPoolStat *out = new(int64) **out = **in } + if in.ObservedState != nil { + in, out := &in.ObservedState, &out.ObservedState + *out = new(WorkerpoolObservedStateStatus) + (*in).DeepCopyInto(*out) + } if in.ResourceID != nil { in, out := &in.ResourceID, &out.ResourceID *out = new(string) @@ -1274,6 +1279,59 @@ func (in *WorkerpoolNetworkConfig) DeepCopy() *WorkerpoolNetworkConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerpoolNetworkConfigStatus) DeepCopyInto(out *WorkerpoolNetworkConfigStatus) { + *out = *in + if in.EgressOption != nil { + in, out := &in.EgressOption, &out.EgressOption + *out = new(string) + **out = **in + } + if in.PeeredNetwork != nil { + in, out := &in.PeeredNetwork, &out.PeeredNetwork + *out = new(string) + **out = **in + } + if in.PeeredNetworkIpRange != nil { + in, out := &in.PeeredNetworkIpRange, &out.PeeredNetworkIpRange + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerpoolNetworkConfigStatus. +func (in *WorkerpoolNetworkConfigStatus) DeepCopy() *WorkerpoolNetworkConfigStatus { + if in == nil { + return nil + } + out := new(WorkerpoolNetworkConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerpoolObservedStateStatus) DeepCopyInto(out *WorkerpoolObservedStateStatus) { + *out = *in + if in.NetworkConfig != nil { + in, out := &in.NetworkConfig, &out.NetworkConfig + *out = new(WorkerpoolNetworkConfigStatus) + (*in).DeepCopyInto(*out) + } + in.WorkerConfig.DeepCopyInto(&out.WorkerConfig) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerpoolObservedStateStatus. +func (in *WorkerpoolObservedStateStatus) DeepCopy() *WorkerpoolObservedStateStatus { + if in == nil { + return nil + } + out := new(WorkerpoolObservedStateStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WorkerpoolParent) DeepCopyInto(out *WorkerpoolParent) { *out = *in @@ -1338,3 +1396,29 @@ func (in *WorkerpoolWorkerConfig) DeepCopy() *WorkerpoolWorkerConfig { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkerpoolWorkerConfigStatus) DeepCopyInto(out *WorkerpoolWorkerConfigStatus) { + *out = *in + if in.DiskSizeGb != nil { + in, out := &in.DiskSizeGb, &out.DiskSizeGb + *out = new(int64) + **out = **in + } + if in.MachineType != nil { + in, out := &in.MachineType, &out.MachineType + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerpoolWorkerConfigStatus. +func (in *WorkerpoolWorkerConfigStatus) DeepCopy() *WorkerpoolWorkerConfigStatus { + if in == nil { + return nil + } + out := new(WorkerpoolWorkerConfigStatus) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/clients/generated/apis/logging/v1beta1/logginglogmetric_types.go b/pkg/clients/generated/apis/logging/v1beta1/logginglogmetric_types.go index ee196d6fad7..2f3b3185e7a 100644 --- a/pkg/clients/generated/apis/logging/v1beta1/logginglogmetric_types.go +++ b/pkg/clients/generated/apis/logging/v1beta1/logginglogmetric_types.go @@ -219,7 +219,7 @@ type LoggingLogMetricStatus struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:resource:categories=gcp,shortName=gcplogginglogmetric;gcplogginglogmetrics // +kubebuilder:subresource:status -// +kubebuilder:metadata:labels="cnrm.cloud.google.com/directcrd=true";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/system=true" +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/system=true" // +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" // +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" // +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" diff --git a/pkg/controller/direct/cloudbuild/workerpool_controller.go b/pkg/controller/direct/cloudbuild/workerpool_controller.go index d13c70802c1..2fc140036b0 100644 --- a/pkg/controller/direct/cloudbuild/workerpool_controller.go +++ b/pkg/controller/direct/cloudbuild/workerpool_controller.go @@ -39,20 +39,18 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" ) func init() { - directbase.ControllerBuilder.Register(krm.GroupVersionKind, AddCloudBuildWorkerPoolController) + directbase.ControllerBuilder.RegisterModel(krm.GroupVersionKind, NewModel) } -const ctrlName = "cloudbuild-controller" - -// AddCloudBuildWorkerPoolController creates a new controller and adds it to the Manager. -func AddCloudBuildWorkerPoolController(mgr manager.Manager, config *controller.Config, opts directbase.Deps) error { - return directbase.Add(mgr, krm.GroupVersionKind, &model{config: config}, opts) +func NewModel(config *controller.Config) directbase.Model { + return &model{config: config} } +const ctrlName = "cloudbuild-controller" + var _ directbase.Model = &model{} type model struct {