diff --git a/apis/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig_identity.go b/apis/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig_identity.go index 71c2bd13c8f9..faf40e35ddea 100644 --- a/apis/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig_identity.go +++ b/apis/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig_identity.go @@ -60,6 +60,10 @@ func (i *NetworkSecurityBackendAuthenticationConfigIdentity) Host() string { return NetworkSecurityBackendAuthenticationConfigIdentityFormat.Host() } +func (i *NetworkSecurityBackendAuthenticationConfigIdentity) ParentString() string { + return fmt.Sprintf("projects/%s/locations/%s", i.Project, i.Location) +} + func getIdentityFromNetworkSecurityBackendAuthenticationConfigSpec(ctx context.Context, reader client.Reader, obj client.Object) (*NetworkSecurityBackendAuthenticationConfigIdentity, error) { resource, ok := obj.(*NetworkSecurityBackendAuthenticationConfig) if !ok { diff --git a/config/tests/samples/create/harness.go b/config/tests/samples/create/harness.go index b03dd6421b7c..c57e55f7e84f 100644 --- a/config/tests/samples/create/harness.go +++ b/config/tests/samples/create/harness.go @@ -1241,6 +1241,7 @@ func MaybeSkip(t *testing.T, testKey string, resources []*unstructured.Unstructu case schema.GroupKind{Group: "networkservices.cnrm.cloud.google.com", Kind: "NetworkServicesAuthzExtension"}: case schema.GroupKind{Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityAuthorizationPolicy"}: + case schema.GroupKind{Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityBackendAuthenticationConfig"}: case schema.GroupKind{Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityAuthzPolicy"}: case schema.GroupKind{Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityServerTLSPolicy"}: case schema.GroupKind{Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityMirroringDeployment"}: diff --git a/mockgcp/mocknetworksecurity/backendauthenticationconfig.go b/mockgcp/mocknetworksecurity/backendauthenticationconfig.go new file mode 100644 index 000000000000..193a17d1cf71 --- /dev/null +++ b/mockgcp/mocknetworksecurity/backendauthenticationconfig.go @@ -0,0 +1,121 @@ +// Copyright 2026 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. + +package mocknetworksecurity + +import ( + "context" + "fmt" + "time" + + pbv1 "cloud.google.com/go/networksecurity/apiv1/networksecuritypb" + "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (s *NetworkSecurityV1Server) CreateBackendAuthenticationConfig(ctx context.Context, req *pbv1.CreateBackendAuthenticationConfigRequest) (*longrunning.Operation, error) { + name := req.Parent + "/backendAuthenticationConfigs/" + req.BackendAuthenticationConfigId + + fqn := name + + obj := proto.Clone(req.BackendAuthenticationConfig).(*pbv1.BackendAuthenticationConfig) + obj.Name = fqn + obj.CreateTime = timestamppb.New(time.Now()) + obj.UpdateTime = timestamppb.New(time.Now()) + obj.Etag = fmt.Sprintf("%d", time.Now().UnixNano()) + + if err := s.storage.Create(ctx, fqn, obj); err != nil { + return nil, err + } + + metadata := &pbv1.OperationMetadata{ + CreateTime: obj.CreateTime, + Target: fqn, + Verb: "create", + } + + return s.operations.StartLRO(ctx, fqn, metadata, func() (proto.Message, error) { + return obj, nil + }) +} + +func (s *NetworkSecurityV1Server) GetBackendAuthenticationConfig(ctx context.Context, req *pbv1.GetBackendAuthenticationConfigRequest) (*pbv1.BackendAuthenticationConfig, error) { + fqn := req.Name + + obj := &pbv1.BackendAuthenticationConfig{} + if err := s.storage.Get(ctx, fqn, obj); err != nil { + if status.Code(err) == codes.NotFound { + return nil, status.Errorf(codes.NotFound, "BackendAuthenticationConfig %q not found", fqn) + } + return nil, err + } + + return obj, nil +} + +func (s *NetworkSecurityV1Server) UpdateBackendAuthenticationConfig(ctx context.Context, req *pbv1.UpdateBackendAuthenticationConfigRequest) (*longrunning.Operation, error) { + fqn := req.BackendAuthenticationConfig.Name + + existing := &pbv1.BackendAuthenticationConfig{} + if err := s.storage.Get(ctx, fqn, existing); err != nil { + return nil, err + } + + obj := proto.Clone(req.BackendAuthenticationConfig).(*pbv1.BackendAuthenticationConfig) + obj.Name = fqn + obj.CreateTime = existing.CreateTime + obj.UpdateTime = timestamppb.New(time.Now()) + obj.Etag = fmt.Sprintf("%d", time.Now().UnixNano()) + + if err := s.storage.Update(ctx, fqn, obj); err != nil { + return nil, err + } + + metadata := &pbv1.OperationMetadata{ + CreateTime: obj.UpdateTime, + Target: fqn, + Verb: "update", + } + + return s.operations.StartLRO(ctx, fqn, metadata, func() (proto.Message, error) { + return obj, nil + }) +} + +func (s *NetworkSecurityV1Server) DeleteBackendAuthenticationConfig(ctx context.Context, req *pbv1.DeleteBackendAuthenticationConfigRequest) (*longrunning.Operation, error) { + fqn := req.Name + + existing := &pbv1.BackendAuthenticationConfig{} + if err := s.storage.Get(ctx, fqn, existing); err != nil { + return nil, err + } + + deleted := &pbv1.BackendAuthenticationConfig{} + if err := s.storage.Delete(ctx, fqn, deleted); err != nil { + return nil, err + } + + metadata := &pbv1.OperationMetadata{ + CreateTime: timestamppb.New(time.Now()), + Target: fqn, + Verb: "delete", + } + + return s.operations.StartLRO(ctx, fqn, metadata, func() (proto.Message, error) { + return deleted, nil + }) +} diff --git a/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_controller.go b/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_controller.go new file mode 100644 index 000000000000..6e853a96c308 --- /dev/null +++ b/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_controller.go @@ -0,0 +1,317 @@ +// Copyright 2026 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. + +package networksecurity + +import ( + "context" + "fmt" + "time" + + krm "github.com/GoogleCloudPlatform/k8s-config-connector/apis/networksecurity/v1alpha1" + refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/config" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/common" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/tags" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/structuredreporting" + + pb "cloud.google.com/go/networksecurity/apiv1/networksecuritypb" + "google.golang.org/api/option" + "google.golang.org/api/transport/grpc" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" + "google.golang.org/protobuf/types/known/fieldmaskpb" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/klog/v2" +) + +func init() { + registry.RegisterModel(krm.NetworkSecurityBackendAuthenticationConfigGVK, NewBackendAuthenticationConfigModel) +} + +func NewBackendAuthenticationConfigModel(ctx context.Context, config *config.ControllerConfig) (directbase.Model, error) { + return &backendAuthenticationConfigModel{config: *config}, nil +} + +var _ directbase.Model = &backendAuthenticationConfigModel{} + +type backendAuthenticationConfigModel struct { + config config.ControllerConfig +} + +func (m *backendAuthenticationConfigModel) client(ctx context.Context) (pb.NetworkSecurityClient, longrunningpb.OperationsClient, error) { + var opts []option.ClientOption + opts, err := m.config.GRPCClientOptions() + if err != nil { + return nil, nil, err + } + opts = append(opts, option.WithEndpoint("networksecurity.googleapis.com:443")) + conn, err := grpc.Dial(ctx, opts...) + if err != nil { + return nil, nil, fmt.Errorf("dialing networksecurity service: %w", err) + } + return pb.NewNetworkSecurityClient(conn), longrunningpb.NewOperationsClient(conn), nil +} + +func (m *backendAuthenticationConfigModel) AdapterForObject(ctx context.Context, op *directbase.AdapterForObjectOperation) (directbase.Adapter, error) { + u := op.GetUnstructured() + reader := op.Reader + obj := &krm.NetworkSecurityBackendAuthenticationConfig{} + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, &obj); err != nil { + return nil, fmt.Errorf("error converting to %T: %w", obj, err) + } + + if err := common.NormalizeReferences(ctx, reader, obj, nil); err != nil { + return nil, fmt.Errorf("normalizing references: %w", err) + } + + id, err := obj.GetIdentity(ctx, reader) + if err != nil { + return nil, err + } + + gcpClient, operationsClient, err := m.client(ctx) + if err != nil { + return nil, err + } + + mapCtx := &direct.MapContext{} + desired := NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_ToProto(mapCtx, &obj.Spec) + if mapCtx.Err() != nil { + return nil, mapCtx.Err() + } + + desired.Name = id.(*krm.NetworkSecurityBackendAuthenticationConfigIdentity).String() + + return &backendAuthenticationConfigAdapter{ + id: id.(*krm.NetworkSecurityBackendAuthenticationConfigIdentity), + gcpClient: gcpClient, + operationsClient: operationsClient, + desired: desired, + }, nil +} + +func (m *backendAuthenticationConfigModel) AdapterForURL(ctx context.Context, url string) (directbase.Adapter, error) { + return nil, nil +} + +type backendAuthenticationConfigAdapter struct { + id *krm.NetworkSecurityBackendAuthenticationConfigIdentity + gcpClient pb.NetworkSecurityClient + operationsClient longrunningpb.OperationsClient + desired *pb.BackendAuthenticationConfig + actual *pb.BackendAuthenticationConfig +} + +var _ directbase.Adapter = &backendAuthenticationConfigAdapter{} + +func (a *backendAuthenticationConfigAdapter) Find(ctx context.Context) (bool, error) { + log := klog.FromContext(ctx) + log.V(2).Info("getting BackendAuthenticationConfig", "name", a.id) + + req := &pb.GetBackendAuthenticationConfigRequest{Name: a.id.String()} + actual, err := a.gcpClient.GetBackendAuthenticationConfig(ctx, req) + if err != nil { + if direct.IsNotFound(err) { + return false, nil + } + return false, fmt.Errorf("getting BackendAuthenticationConfig %q: %w", a.id, err) + } + + a.actual = actual + return true, nil +} + +func (a *backendAuthenticationConfigAdapter) Create(ctx context.Context, createOp *directbase.CreateOperation) error { + log := klog.FromContext(ctx) + log.V(2).Info("creating BackendAuthenticationConfig", "name", a.id) + + req := &pb.CreateBackendAuthenticationConfigRequest{ + Parent: a.id.ParentString(), + BackendAuthenticationConfigId: a.id.BackendAuthenticationConfig, + BackendAuthenticationConfig: a.desired, + } + + op, err := a.gcpClient.CreateBackendAuthenticationConfig(ctx, req) + if err != nil { + return fmt.Errorf("creating BackendAuthenticationConfig %s: %w", a.id, err) + } + + err = a.waitForOperation(ctx, op) + if err != nil { + return fmt.Errorf("BackendAuthenticationConfig %s waiting creation: %w", a.id, err) + } + + getReq := &pb.GetBackendAuthenticationConfigRequest{Name: a.id.String()} + latest, err := a.gcpClient.GetBackendAuthenticationConfig(ctx, getReq) + if err != nil { + return fmt.Errorf("getting BackendAuthenticationConfig after creation: %w", err) + } + + log.V(2).Info("successfully created BackendAuthenticationConfig", "name", a.id) + + return a.updateStatus(ctx, createOp, latest) +} + +func (a *backendAuthenticationConfigAdapter) Update(ctx context.Context, updateOp *directbase.UpdateOperation) error { + log := klog.FromContext(ctx) + log.V(2).Info("updating BackendAuthenticationConfig", "name", a.id) + + diffs, updateMask, err := compareBackendAuthenticationConfig(ctx, a.actual, a.desired) + if err != nil { + return err + } + + diffs.Object = updateOp.GetUnstructured() + structuredreporting.ReportDiff(ctx, diffs) + + if !diffs.HasDiff() { + log.V(2).Info("no field needs update", "name", a.id) + return nil + } + + log.V(2).Info("fields need update", "name", a.id, "updateMask", updateMask) + + req := &pb.UpdateBackendAuthenticationConfigRequest{ + UpdateMask: updateMask, + BackendAuthenticationConfig: a.desired, + } + req.BackendAuthenticationConfig.Name = a.id.String() + + op, err := a.gcpClient.UpdateBackendAuthenticationConfig(ctx, req) + if err != nil { + return fmt.Errorf("updating BackendAuthenticationConfig %s: %w", a.id, err) + } + err = a.waitForOperation(ctx, op) + if err != nil { + return fmt.Errorf("BackendAuthenticationConfig %s waiting update: %w", a.id, err) + } + + getReq := &pb.GetBackendAuthenticationConfigRequest{Name: a.id.String()} + latest, err := a.gcpClient.GetBackendAuthenticationConfig(ctx, getReq) + if err != nil { + return fmt.Errorf("getting BackendAuthenticationConfig after update: %w", err) + } + + log.V(2).Info("successfully updated BackendAuthenticationConfig", "name", a.id) + + return a.updateStatus(ctx, updateOp, latest) +} + +func compareBackendAuthenticationConfig(ctx context.Context, actual, desired *pb.BackendAuthenticationConfig) (*structuredreporting.Diff, *fieldmaskpb.FieldMask, error) { + mapCtx := &direct.MapContext{} + spec := NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_FromProto(mapCtx, actual) + if mapCtx.Err() != nil { + return nil, nil, mapCtx.Err() + } + maskedActual := NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_ToProto(mapCtx, spec) + if mapCtx.Err() != nil { + return nil, nil, mapCtx.Err() + } + maskedActual.Name = desired.Name + + diffs, updateMask, err := tags.DiffForTopLevelFields(ctx, desired.ProtoReflect(), maskedActual.ProtoReflect()) + if err != nil { + return nil, nil, err + } + return diffs, updateMask, nil +} + +func (a *backendAuthenticationConfigAdapter) Export(ctx context.Context) (*unstructured.Unstructured, error) { + if a.actual == nil { + return nil, fmt.Errorf("Find() not called") + } + u := &unstructured.Unstructured{} + + obj := &krm.NetworkSecurityBackendAuthenticationConfig{} + mapCtx := &direct.MapContext{} + obj.Spec = direct.ValueOf(NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_FromProto(mapCtx, a.actual)) + if mapCtx.Err() != nil { + return nil, mapCtx.Err() + } + obj.Spec.ProjectRef = &refsv1beta1.ProjectRef{External: a.id.Project} + obj.Spec.Location = &a.id.Location + + uObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) + if err != nil { + return nil, err + } + + u.SetName(a.id.BackendAuthenticationConfig) + u.SetGroupVersionKind(krm.NetworkSecurityBackendAuthenticationConfigGVK) + + u.Object = uObj + return u, nil +} + +func (a *backendAuthenticationConfigAdapter) Delete(ctx context.Context, deleteOp *directbase.DeleteOperation) (bool, error) { + log := klog.FromContext(ctx) + log.V(2).Info("deleting BackendAuthenticationConfig", "name", a.id) + + req := &pb.DeleteBackendAuthenticationConfigRequest{Name: a.id.String()} + op, err := a.gcpClient.DeleteBackendAuthenticationConfig(ctx, req) + if err != nil { + if direct.IsNotFound(err) { + log.V(2).Info("skipping delete for non-existent BackendAuthenticationConfig, assuming it was already deleted", "name", a.id) + return true, nil + } + return false, fmt.Errorf("deleting BackendAuthenticationConfig %s: %w", a.id, err) + } + + err = a.waitForOperation(ctx, op) + if err != nil { + return false, fmt.Errorf("waiting delete BackendAuthenticationConfig %s: %w", a.id, err) + } + + log.V(2).Info("successfully deleted BackendAuthenticationConfig", "name", a.id) + return true, nil +} + +func (a *backendAuthenticationConfigAdapter) updateStatus(ctx context.Context, op directbase.Operation, latest *pb.BackendAuthenticationConfig) error { + mapCtx := &direct.MapContext{} + status := &krm.NetworkSecurityBackendAuthenticationConfigStatus{} + status.ObservedState = NetworkSecurityBackendAuthenticationConfigObservedState_v1alpha1_FromProto(mapCtx, latest) + if mapCtx.Err() != nil { + return mapCtx.Err() + } + status.ExternalRef = direct.LazyPtr(a.id.String()) + return op.UpdateStatus(ctx, status, nil) +} + +func (a *backendAuthenticationConfigAdapter) waitForOperation(ctx context.Context, op *longrunningpb.Operation) error { + for { + req := &longrunningpb.GetOperationRequest{ + Name: op.GetName(), + } + current, err := a.operationsClient.GetOperation(ctx, req) + if err != nil { + return fmt.Errorf("getting operation %q: %w", op.GetName(), err) + } + if current.GetDone() { + if current.GetError() != nil { + return fmt.Errorf("operation failed: %s", current.GetError().GetMessage()) + } + return nil + } + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(1 * time.Second): + } + } +} diff --git a/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_fuzzer.go b/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_fuzzer.go new file mode 100644 index 000000000000..443b8b598d14 --- /dev/null +++ b/pkg/controller/direct/networksecurity/networksecuritybackendauthenticationconfig_fuzzer.go @@ -0,0 +1,49 @@ +// Copyright 2026 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. + +// +tool:fuzz-gen +// proto.message: google.cloud.networksecurity.v1.BackendAuthenticationConfig +// api.group: networksecurity.cnrm.cloud.google.com + +package networksecurity + +import ( + pb "cloud.google.com/go/networksecurity/apiv1/networksecuritypb" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/fuzztesting" +) + +func init() { + fuzztesting.RegisterKRMFuzzer(backendAuthenticationConfigFuzzer()) +} + +func backendAuthenticationConfigFuzzer() fuzztesting.KRMFuzzer { + f := fuzztesting.NewKRMTypedFuzzer(&pb.BackendAuthenticationConfig{}, + NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_FromProto, NetworkSecurityBackendAuthenticationConfigSpec_v1alpha1_ToProto, + NetworkSecurityBackendAuthenticationConfigObservedState_v1alpha1_FromProto, NetworkSecurityBackendAuthenticationConfigObservedState_v1alpha1_ToProto, + ) + + f.SpecField(".labels") + f.SpecField(".description") + f.SpecField(".client_certificate") + f.SpecField(".trust_config") + f.SpecField(".well_known_roots") + + f.StatusField(".create_time") + f.StatusField(".update_time") + f.StatusField(".etag") + + f.Unimplemented_Identity(".name") + + return f +} diff --git a/pkg/controller/resourceconfig/static_config.go b/pkg/controller/resourceconfig/static_config.go index fcf1727eea52..88b9b0951fd9 100644 --- a/pkg/controller/resourceconfig/static_config.go +++ b/pkg/controller/resourceconfig/static_config.go @@ -395,6 +395,7 @@ var ControllerConfigStatic = ResourcesControllerMap{ {Group: "networkmanagement.cnrm.cloud.google.com", Kind: "NetworkManagementConnectivityTest"}: {DefaultController: k8s.ReconcilerTypeDirect, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDirect}}, {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityAuthorizationPolicy"}: {DefaultController: k8s.ReconcilerTypeDCL, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDCL}}, {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityAuthzPolicy"}: {DefaultController: k8s.ReconcilerTypeDirect, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDirect}}, + {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityBackendAuthenticationConfig"}: {DefaultController: k8s.ReconcilerTypeDirect, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDirect}}, {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityClientTLSPolicy"}: {DefaultController: k8s.ReconcilerTypeDCL, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDCL}}, {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityDNSThreatDetector"}: {DefaultController: k8s.ReconcilerTypeDirect, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDirect}}, {Group: "networksecurity.cnrm.cloud.google.com", Kind: "NetworkSecurityFirewallEndpoint"}: {DefaultController: k8s.ReconcilerTypeDirect, SupportedControllers: []k8s.ReconcilerType{k8s.ReconcilerTypeDirect}}, diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_generated_object_backendauthconfig-maximal.golden.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_generated_object_backendauthconfig-maximal.golden.yaml new file mode 100644 index 000000000000..8cc3439cb4d3 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_generated_object_backendauthconfig-maximal.golden.yaml @@ -0,0 +1,33 @@ +apiVersion: networksecurity.cnrm.cloud.google.com/v1alpha1 +kind: NetworkSecurityBackendAuthenticationConfig +metadata: + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + labels: + cnrm-test: "true" + name: backendauth-max-${uniqueId} + namespace: ${uniqueId} +spec: + description: Updated description of backend auth config + labels: + foo: baz + new-key: new-val + location: us-central1 + projectRef: + external: projects/${projectId} + wellKnownRoots: NONE +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + externalRef: projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId} + observedGeneration: 2 + observedState: + createTime: "1970-01-01T00:00:00Z" + etag: abcdef123456 + updateTime: "1970-01-01T00:00:00Z" diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_http_mock.log b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_http_mock.log new file mode 100644 index 000000000000..f5f06b5a8ebb --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_http_mock.log @@ -0,0 +1,301 @@ +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +error: rpc error: code = NotFound desc = BackendAuthenticationConfig "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" not found + +{} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/CreateBackendAuthenticationConfig + +{ + "backendAuthenticationConfig": { + "description": "Original description of backend auth config", + "labels": { + "foo": "bar" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "wellKnownRoots": "PUBLIC_ROOTS" + }, + "backendAuthenticationConfigId": "backendauth-max-${uniqueId}", + "parent": "projects/${projectId}/locations/us-central1" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "create" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "create" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Original description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "bar" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" + } +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Original description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "bar" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Original description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "bar" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/UpdateBackendAuthenticationConfig + +{ + "backendAuthenticationConfig": { + "description": "Updated description of backend auth config", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "wellKnownRoots": "NONE" + }, + "updateMask": "description,labels,wellKnownRoots" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "update" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "update" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Updated description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "NONE" + } +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Updated description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "NONE" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Updated description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "NONE" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Updated description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "NONE" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/DeleteBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "delete" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "verb": "delete" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "createTime": "2024-04-01T12:34:56.123456Z", + "description": "Updated description of backend auth config", + "etag": "abcdef0123A=", + "labels": { + "foo": "baz", + "new-key": "new-val" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "NONE" + } +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_identities.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_identities.yaml new file mode 100644 index 000000000000..c5ada3f00246 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/_identities.yaml @@ -0,0 +1,6 @@ +- caisURL: //networksecurity.googleapis.com/projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-max-${uniqueId} + group: networksecurity.cnrm.cloud.google.com + kind: NetworkSecurityBackendAuthenticationConfig + name: backendauth-max-${uniqueId} + namespace: ${uniqueId} + version: v1alpha1 diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/create.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/create.yaml new file mode 100644 index 000000000000..6f8f1177eb46 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/create.yaml @@ -0,0 +1,12 @@ +apiVersion: networksecurity.cnrm.cloud.google.com/v1alpha1 +kind: NetworkSecurityBackendAuthenticationConfig +metadata: + name: backendauth-max-${uniqueId} +spec: + projectRef: + external: "projects/${projectId}" + location: us-central1 + description: "Original description of backend auth config" + labels: + foo: bar + wellKnownRoots: PUBLIC_ROOTS diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/update.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/update.yaml new file mode 100644 index 000000000000..33546f59b814 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-maximal/update.yaml @@ -0,0 +1,13 @@ +apiVersion: networksecurity.cnrm.cloud.google.com/v1alpha1 +kind: NetworkSecurityBackendAuthenticationConfig +metadata: + name: backendauth-max-${uniqueId} +spec: + projectRef: + external: "projects/${projectId}" + location: us-central1 + description: "Updated description of backend auth config" + labels: + foo: baz + new-key: new-val + wellKnownRoots: NONE diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_generated_object_backendauthconfig-minimal.golden.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_generated_object_backendauthconfig-minimal.golden.yaml new file mode 100644 index 000000000000..0666ccca627b --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_generated_object_backendauthconfig-minimal.golden.yaml @@ -0,0 +1,29 @@ +apiVersion: networksecurity.cnrm.cloud.google.com/v1alpha1 +kind: NetworkSecurityBackendAuthenticationConfig +metadata: + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 1 + labels: + cnrm-test: "true" + name: backendauth-min-${uniqueId} + namespace: ${uniqueId} +spec: + location: us-central1 + projectRef: + external: projects/${projectId} + wellKnownRoots: PUBLIC_ROOTS +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + externalRef: projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId} + observedGeneration: 1 + observedState: + createTime: "1970-01-01T00:00:00Z" + etag: abcdef123456 + updateTime: "1970-01-01T00:00:00Z" diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_http_mock.log b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_http_mock.log new file mode 100644 index 000000000000..a13b05c35f26 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_http_mock.log @@ -0,0 +1,166 @@ +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" +} + +error: rpc error: code = NotFound desc = BackendAuthenticationConfig "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" not found + +{} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/CreateBackendAuthenticationConfig + +{ + "backendAuthenticationConfig": { + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "wellKnownRoots": "PUBLIC_ROOTS" + }, + "backendAuthenticationConfigId": "backendauth-min-${uniqueId}", + "parent": "projects/${projectId}/locations/us-central1" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "verb": "create" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "verb": "create" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "createTime": "2024-04-01T12:34:56.123456Z", + "etag": "abcdef0123A=", + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" + } +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "etag": "abcdef0123A=", + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "etag": "abcdef0123A=", + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/GetBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" +} + +OK + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "etag": "abcdef0123A=", + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" +} + +--- + +GRPC /google.cloud.networksecurity.v1.NetworkSecurity/DeleteBackendAuthenticationConfig + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "verb": "delete" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata", + "createTime": "2024-04-01T12:34:56.123456Z", + "target": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "verb": "delete" + }, + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}/operations/${operationID}", + "response": { + "@type": "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "createTime": "2024-04-01T12:34:56.123456Z", + "etag": "abcdef0123A=", + "name": "projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "wellKnownRoots": "PUBLIC_ROOTS" + } +} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_identities.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_identities.yaml new file mode 100644 index 000000000000..679278a02a93 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/_identities.yaml @@ -0,0 +1,6 @@ +- caisURL: //networksecurity.googleapis.com/projects/${projectId}/locations/us-central1/backendAuthenticationConfigs/backendauth-min-${uniqueId} + group: networksecurity.cnrm.cloud.google.com + kind: NetworkSecurityBackendAuthenticationConfig + name: backendauth-min-${uniqueId} + namespace: ${uniqueId} + version: v1alpha1 diff --git a/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/create.yaml b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/create.yaml new file mode 100644 index 000000000000..9d46b101521f --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/networksecurity/v1alpha1/networksecuritybackendauthenticationconfig/backendauthconfig-minimal/create.yaml @@ -0,0 +1,9 @@ +apiVersion: networksecurity.cnrm.cloud.google.com/v1alpha1 +kind: NetworkSecurityBackendAuthenticationConfig +metadata: + name: backendauth-min-${uniqueId} +spec: + projectRef: + external: "projects/${projectId}" + location: us-central1 + wellKnownRoots: PUBLIC_ROOTS diff --git a/tests/apichecks/testdata/exceptions/alpha-missingfields.txt b/tests/apichecks/testdata/exceptions/alpha-missingfields.txt index e39b76b1eb04..dc14031e0db9 100644 --- a/tests/apichecks/testdata/exceptions/alpha-missingfields.txt +++ b/tests/apichecks/testdata/exceptions/alpha-missingfields.txt @@ -3114,12 +3114,7 @@ [missing_field] crd=networksecurityauthzpolicies.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.target.resources[].name" is not set in unstructured objects [missing_field] crd=networksecurityauthzpolicies.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.target.resources[].namespace" is not set in unstructured objects [missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.clientCertificateRef" is not set; neither 'external' nor 'name' are set -[missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.description" is not set in unstructured objects -[missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.labels" is not set in unstructured objects -[missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.location" is not set in unstructured objects -[missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.projectRef" is not set; neither 'external' nor 'name' are set [missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.trustConfigRef" is not set; neither 'external' nor 'name' are set -[missing_field] crd=networksecuritybackendauthenticationconfigs.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.wellKnownRoots" is not set in unstructured objects [missing_field] crd=networksecurityfirewallendpointassociations.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.tlsInspectionPolicyRef" is not set; neither 'external' nor 'name' are set [missing_field] crd=networksecuritygatewaysecuritypolicies.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.tlsInspectionPolicyRef" is not set; neither 'external' nor 'name' are set [missing_field] crd=networksecurityinterceptdeployments.networksecurity.cnrm.cloud.google.com version=v1alpha1: field ".spec.description" is not set in unstructured objects