Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions apis/batch/v1alpha1/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Copyright 2025 Google LLC
#
# 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.


set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT="$(git rev-parse --show-toplevel)"
cd ${REPO_ROOT}/dev/tools/controllerbuilder

go run . generate-types \
--service google.cloud.batch.v1 \
--api-version "batch.cnrm.cloud.google.com/v1alpha1" \
--resource BatchTask:Task


go run . generate-mapper \
--service google.cloud.batch.v1 \
--api-version "batch.cnrm.cloud.google.com/v1alpha1"

cd ${REPO_ROOT}
dev/tasks/generate-crds

go run -mod=readonly golang.org/x/tools/cmd/goimports@latest -w pkg/controller/direct/batch/

118 changes: 0 additions & 118 deletions apis/batch/v1alpha1/job_identity.go

This file was deleted.

83 changes: 0 additions & 83 deletions apis/batch/v1alpha1/job_reference.go

This file was deleted.

11 changes: 11 additions & 0 deletions apis/batch/v1alpha1/task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,23 @@
package v1alpha1

import (
"github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var BatchTaskGVK = GroupVersion.WithKind("BatchTask")

type Parent struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Isn't this *parent.ProjectAndLocationRef

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. But this PR should only contain code for BatchJob promotion.

// Immutable. The location where the alloydb cluster should reside.
// +required
Location *string `json:"location,omitempty"`

// The project that this resource belongs to.
// +required
ProjectRef *v1beta1.ProjectRef `json:"projectRef,omitempty"`
}

// BatchTaskSpec defines the desired state of BatchTask
// +kcc:spec:proto=google.cloud.batch.v1.Task
type BatchTaskSpec struct {
Expand Down
Loading
Loading