Skip to content

Commit a01bd11

Browse files
committed
Fix presubmit errors
1 parent 99393cf commit a01bd11

File tree

4 files changed

+48
-20
lines changed

4 files changed

+48
-20
lines changed

pkg/controller/direct/colab/mapper.generated.go

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/controller/direct/colab/runtimetemplate_fuzzer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ func colabRuntimeTemplateFuzzer() fuzztesting.KRMFuzzer {
3535

3636
f.UnimplementedFields.Insert(".name") // special field
3737
f.UnimplementedFields.Insert(".is_default") // deprecated field
38+
// "software_config" field is unsupported in third_party because we use an
39+
// old googleapis version. Automation tools don't know this field.
40+
// However, it is supported in the version of cloud.google.com/go/aiplatform
41+
// we define in go.mod.
42+
f.UnimplementedFields.Insert(".software_config")
3843

3944
f.SpecFields.Insert(".display_name")
4045
f.SpecFields.Insert(".description")
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package colab
16+
17+
import (
18+
pb "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb"
19+
krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/colab/v1alpha1"
20+
refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1"
21+
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct"
22+
)
23+
24+
func EncryptionSpec_FromProto(mapCtx *direct.MapContext, in *pb.EncryptionSpec) *krm.EncryptionSpec {
25+
if in == nil {
26+
return nil
27+
}
28+
out := &krm.EncryptionSpec{}
29+
if in.KmsKeyName != "" {
30+
out.KMSKeyRef = &refs.KMSCryptoKeyRef{External: in.KmsKeyName}
31+
}
32+
return out
33+
}
34+
func EncryptionSpec_ToProto(mapCtx *direct.MapContext, in *krm.EncryptionSpec) *pb.EncryptionSpec {
35+
if in == nil {
36+
return nil
37+
}
38+
out := &pb.EncryptionSpec{}
39+
if in.KMSKeyRef != nil {
40+
out.KmsKeyName = in.KMSKeyRef.External
41+
}
42+
return out
43+
}

pkg/test/resourcefixture/testdata/basic/colab/v1alpha1/colabruntimetemplate/basiccolabruntimetemplate/_http.log

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ GET https://us-central1-aiplatform.googleapis.com/v1beta1/projects/${projectId}/
261261
Content-Type: application/json
262262
User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion}
263263
X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2FnotebookRuntimeTemplates%2Fcolabruntimetemplate-${uniqueId}
264-
X-Goog-User-Project: ${projectId}
265264

266265
404 Not Found
267266
Content-Type: application/json; charset=UTF-8
@@ -287,7 +286,6 @@ POST https://us-central1-aiplatform.googleapis.com/v1beta1/projects/${projectId}
287286
Content-Type: application/json
288287
User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion}
289288
X-Goog-Request-Params: parent=projects%2F${projectId}%2Flocations%2Fus-central1
290-
X-Goog-User-Project: ${projectId}
291289

292290
{
293291
"displayName": "test-${uniqueId}",
@@ -332,7 +330,6 @@ GET https://us-central1-aiplatform.googleapis.com/v1beta1/projects/${projectId}/
332330
Content-Type: application/json
333331
User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion}
334332
X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2FnotebookRuntimeTemplates%2Fcolabruntimetemplate-${uniqueId}
335-
X-Goog-User-Project: ${projectId}
336333

337334
200 OK
338335
Content-Type: application/json; charset=UTF-8
@@ -369,7 +366,6 @@ DELETE https://us-central1-aiplatform.googleapis.com/v1beta1/projects/${projectI
369366
Content-Type: application/json
370367
User-Agent: kcc/${kccVersion} (+https://github.com/GoogleCloudPlatform/k8s-config-connector) kcc/controller-manager/${kccVersion}
371368
X-Goog-Request-Params: name=projects%2F${projectId}%2Flocations%2Fus-central1%2FnotebookRuntimeTemplates%2Fcolabruntimetemplate-${uniqueId}
372-
X-Goog-User-Project: ${projectId}
373369

374370
200 OK
375371
Content-Type: application/json; charset=UTF-8

0 commit comments

Comments
 (0)