Skip to content

Commit

Permalink
Automated DCL import.
Browse files Browse the repository at this point in the history
  - 8112869 Automatic import from cloud_mmv2_dcl_20220422_1651_RC00 by DCL Team <[email protected]>

GitOrigin-RevId: 8112869
  • Loading branch information
DCL Team authored and copybara-github committed Apr 23, 2022
1 parent 6d84311 commit f19abc7
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 58 deletions.
3 changes: 1 addition & 2 deletions python/proto/run/alpha/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ message RunAlphaServiceTemplate {
string service_account = 8;
repeated RunAlphaServiceTemplateContainers containers = 9;
repeated RunAlphaServiceTemplateVolumes volumes = 10;
bool confidential = 11;
RunAlphaServiceTemplateExecutionEnvironmentEnum execution_environment = 12;
RunAlphaServiceTemplateExecutionEnvironmentEnum execution_environment = 11;
}

message RunAlphaServiceTemplateScaling {
Expand Down
5 changes: 0 additions & 5 deletions python/services/run/alpha/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def __init__(
service_account: str = None,
containers: list = None,
volumes: list = None,
confidential: bool = None,
execution_environment: str = None,
):
self.revision = revision
Expand All @@ -316,7 +315,6 @@ def __init__(
self.service_account = service_account
self.containers = containers
self.volumes = volumes
self.confidential = confidential
self.execution_environment = execution_environment

@classmethod
Expand Down Expand Up @@ -355,8 +353,6 @@ def to_proto(self, resource):
)
if ServiceTemplateVolumesArray.to_proto(resource.volumes):
res.volumes.extend(ServiceTemplateVolumesArray.to_proto(resource.volumes))
if Primitive.to_proto(resource.confidential):
res.confidential = Primitive.to_proto(resource.confidential)
if ServiceTemplateExecutionEnvironmentEnum.to_proto(
resource.execution_environment
):
Expand All @@ -381,7 +377,6 @@ def from_proto(self, resource):
service_account=Primitive.from_proto(resource.service_account),
containers=ServiceTemplateContainersArray.from_proto(resource.containers),
volumes=ServiceTemplateVolumesArray.from_proto(resource.volumes),
confidential=Primitive.from_proto(resource.confidential),
execution_environment=ServiceTemplateExecutionEnvironmentEnum.from_proto(
resource.execution_environment
),
Expand Down
2 changes: 0 additions & 2 deletions python/services/run/alpha/service_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ func ProtoToRunAlphaServiceTemplate(p *alphapb.RunAlphaServiceTemplate) *alpha.S
ContainerConcurrency: dcl.Int64OrNil(p.GetContainerConcurrency()),
Timeout: dcl.StringOrNil(p.GetTimeout()),
ServiceAccount: dcl.StringOrNil(p.GetServiceAccount()),
Confidential: dcl.Bool(p.GetConfidential()),
ExecutionEnvironment: ProtoToRunAlphaServiceTemplateExecutionEnvironmentEnum(p.GetExecutionEnvironment()),
}
for _, r := range p.GetContainers() {
Expand Down Expand Up @@ -644,7 +643,6 @@ func RunAlphaServiceTemplateToProto(o *alpha.ServiceTemplate) *alphapb.RunAlphaS
p.SetContainerConcurrency(dcl.ValueOrEmptyInt64(o.ContainerConcurrency))
p.SetTimeout(dcl.ValueOrEmptyString(o.Timeout))
p.SetServiceAccount(dcl.ValueOrEmptyString(o.ServiceAccount))
p.SetConfidential(dcl.ValueOrEmptyBool(o.Confidential))
p.SetExecutionEnvironment(RunAlphaServiceTemplateExecutionEnvironmentEnumToProto(o.ExecutionEnvironment))
mLabels := make(map[string]string, len(o.Labels))
for k, r := range o.Labels {
Expand Down
1 change: 1 addition & 0 deletions services/google/compute/alpha/forwarding_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ components:
description: Service Directory resources to register this forwarding rule
with. Currently, only supports a single Service Directory resource.
x-kubernetes-immutable: true
x-dcl-server-default: true
x-dcl-send-empty: true
x-dcl-list-type: list
items:
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions services/google/compute/beta/forwarding_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ components:
description: Service Directory resources to register this forwarding rule
with. Currently, only supports a single Service Directory resource.
x-kubernetes-immutable: true
x-dcl-server-default: true
x-dcl-send-empty: true
x-dcl-list-type: list
items:
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions services/google/compute/forwarding_rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ components:
description: Service Directory resources to register this forwarding rule
with. Currently, only supports a single Service Directory resource.
x-kubernetes-immutable: true
x-dcl-server-default: true
x-dcl-send-empty: true
x-dcl-list-type: list
items:
Expand Down
6 changes: 3 additions & 3 deletions services/google/compute/forwarding_rule_yaml_embed.go

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions services/google/run/alpha/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ type ServiceTemplate struct {
ServiceAccount *string `json:"serviceAccount"`
Containers []ServiceTemplateContainers `json:"containers"`
Volumes []ServiceTemplateVolumes `json:"volumes"`
Confidential *bool `json:"confidential"`
ExecutionEnvironment *ServiceTemplateExecutionEnvironmentEnum `json:"executionEnvironment"`
}

Expand Down Expand Up @@ -511,8 +510,6 @@ func (r *ServiceTemplate) UnmarshalJSON(data []byte) error {

r.Volumes = res.Volumes

r.Confidential = res.Confidential

r.ExecutionEnvironment = res.ExecutionEnvironment

}
Expand Down
5 changes: 0 additions & 5 deletions services/google/run/alpha/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,6 @@ components:
type: string
x-dcl-go-name: Annotations
description: KRM-style annotations for the resource.
confidential:
type: boolean
x-dcl-go-name: Confidential
description: Enables Confidential Cloud Run in Revisions created using
this template.
containerConcurrency:
type: integer
format: int64
Expand Down
6 changes: 3 additions & 3 deletions services/google/run/alpha/service_alpha_yaml_embed.go

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions services/google/run/alpha/service_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,11 +1042,6 @@ func canonicalizeServiceTemplate(des, initial *ServiceTemplate, opts ...dcl.Appl
}
cDes.Containers = canonicalizeServiceTemplateContainersSlice(des.Containers, initial.Containers, opts...)
cDes.Volumes = canonicalizeServiceTemplateVolumesSlice(des.Volumes, initial.Volumes, opts...)
if dcl.BoolCanonicalize(des.Confidential, initial.Confidential) || dcl.IsZeroValue(des.Confidential) {
cDes.Confidential = initial.Confidential
} else {
cDes.Confidential = des.Confidential
}
if dcl.IsZeroValue(des.ExecutionEnvironment) || (dcl.IsEmptyValueIndirect(des.ExecutionEnvironment) && dcl.IsEmptyValueIndirect(initial.ExecutionEnvironment)) {
// Desired and initial values are equivalent, so set canonical desired value to initial value.
cDes.ExecutionEnvironment = initial.ExecutionEnvironment
Expand Down Expand Up @@ -1109,9 +1104,6 @@ func canonicalizeNewServiceTemplate(c *Client, des, nw *ServiceTemplate) *Servic
}
nw.Containers = canonicalizeNewServiceTemplateContainersSlice(c, des.Containers, nw.Containers)
nw.Volumes = canonicalizeNewServiceTemplateVolumesSlice(c, des.Volumes, nw.Volumes)
if dcl.BoolCanonicalize(des.Confidential, nw.Confidential) {
nw.Confidential = des.Confidential
}

return nw
}
Expand Down Expand Up @@ -3622,13 +3614,6 @@ func compareServiceTemplateNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.Confidential, actual.Confidential, dcl.Info{OperationSelector: dcl.TriggersOperation("updateServiceUpdateServiceOperation")}, fn.AddNest("Confidential")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
}
diffs = append(diffs, ds...)
}

if ds, err := dcl.Diff(desired.ExecutionEnvironment, actual.ExecutionEnvironment, dcl.Info{Type: "EnumType", OperationSelector: dcl.TriggersOperation("updateServiceUpdateServiceOperation")}, fn.AddNest("ExecutionEnvironment")); len(ds) != 0 || err != nil {
if err != nil {
return nil, err
Expand Down Expand Up @@ -4774,9 +4759,6 @@ func expandServiceTemplate(c *Client, f *ServiceTemplate, res *Service) (map[str
} else if v != nil {
m["volumes"] = v
}
if v := f.Confidential; !dcl.IsEmptyValueIndirect(v) {
m["confidential"] = v
}
if v := f.ExecutionEnvironment; !dcl.IsEmptyValueIndirect(v) {
m["executionEnvironment"] = v
}
Expand Down Expand Up @@ -4807,7 +4789,6 @@ func flattenServiceTemplate(c *Client, i interface{}, res *Service) *ServiceTemp
r.ServiceAccount = dcl.FlattenString(m["serviceAccount"])
r.Containers = flattenServiceTemplateContainersSlice(c, m["containers"], res)
r.Volumes = flattenServiceTemplateVolumesSlice(c, m["volumes"], res)
r.Confidential = dcl.FlattenBool(m["confidential"])
r.ExecutionEnvironment = flattenServiceTemplateExecutionEnvironmentEnum(m["executionEnvironment"])

return r
Expand Down
10 changes: 0 additions & 10 deletions unstructured/google/run/alpha/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ func ServiceToUnstructured(r *dclService.Service) *unstructured.Resource {
}
rTemplate["annotations"] = rTemplateAnnotations
}
if r.Template.Confidential != nil {
rTemplate["confidential"] = *r.Template.Confidential
}
if r.Template.ContainerConcurrency != nil {
rTemplate["containerConcurrency"] = *r.Template.ContainerConcurrency
}
Expand Down Expand Up @@ -573,13 +570,6 @@ func UnstructuredToService(u *unstructured.Resource) (*dclService.Service, error
return nil, fmt.Errorf("r.Template.Annotations: expected map[string]interface{}")
}
}
if _, ok := rTemplate["confidential"]; ok {
if b, ok := rTemplate["confidential"].(bool); ok {
r.Template.Confidential = dcl.Bool(b)
} else {
return nil, fmt.Errorf("r.Template.Confidential: expected bool")
}
}
if _, ok := rTemplate["containerConcurrency"]; ok {
if i, ok := rTemplate["containerConcurrency"].(int64); ok {
r.Template.ContainerConcurrency = dcl.Int64(i)
Expand Down

0 comments on commit f19abc7

Please sign in to comment.