Skip to content

Commit

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

GitOrigin-RevId: 66f7afd2dbf9bf26c4e21685ee5fef56012df7b5
  • Loading branch information
DCL Team authored and copybara-github committed Jun 24, 2024
1 parent c3703a0 commit f567e1e
Show file tree
Hide file tree
Showing 27 changed files with 165 additions and 12 deletions.
1 change: 1 addition & 0 deletions python/proto/clouddeploy/alpha/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ message ClouddeployAlphaTarget {
message ClouddeployAlphaTargetGke {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployAlphaTargetAnthosCluster {
Expand Down
1 change: 1 addition & 0 deletions python/proto/clouddeploy/beta/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ message ClouddeployBetaTarget {
message ClouddeployBetaTargetGke {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployBetaTargetAnthosCluster {
Expand Down
1 change: 1 addition & 0 deletions python/proto/clouddeploy/target.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ message ClouddeployTarget {
message ClouddeployTargetGke {
string cluster = 1;
bool internal_ip = 2;
string proxy_url = 3;
}

message ClouddeployTargetAnthosCluster {
Expand Down
8 changes: 7 additions & 1 deletion python/services/clouddeploy/alpha/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,12 @@ def to_proto(self):

class TargetGke(object):

def __init__(self, cluster: str = None, internal_ip: bool = None):
def __init__(
self, cluster: str = None, internal_ip: bool = None, proxy_url: str = None
):
self.cluster = cluster
self.internal_ip = internal_ip
self.proxy_url = proxy_url

@classmethod
def to_proto(self, resource):
Expand All @@ -288,6 +291,8 @@ def to_proto(self, resource):
res.cluster = Primitive.to_proto(resource.cluster)
if Primitive.to_proto(resource.internal_ip):
res.internal_ip = Primitive.to_proto(resource.internal_ip)
if Primitive.to_proto(resource.proxy_url):
res.proxy_url = Primitive.to_proto(resource.proxy_url)
return res

@classmethod
Expand All @@ -298,6 +303,7 @@ def from_proto(self, resource):
return TargetGke(
cluster=Primitive.from_proto(resource.cluster),
internal_ip=Primitive.from_proto(resource.internal_ip),
proxy_url=Primitive.from_proto(resource.proxy_url),
)


Expand Down
2 changes: 2 additions & 0 deletions python/services/clouddeploy/alpha/target_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func ProtoToClouddeployAlphaTargetGke(p *alphapb.ClouddeployAlphaTargetGke) *alp
obj := &alpha.TargetGke{
Cluster: dcl.StringOrNil(p.GetCluster()),
InternalIP: dcl.Bool(p.GetInternalIp()),
ProxyUrl: dcl.StringOrNil(p.GetProxyUrl()),
}
return obj
}
Expand Down Expand Up @@ -155,6 +156,7 @@ func ClouddeployAlphaTargetGkeToProto(o *alpha.TargetGke) *alphapb.ClouddeployAl
p := &alphapb.ClouddeployAlphaTargetGke{}
p.SetCluster(dcl.ValueOrEmptyString(o.Cluster))
p.SetInternalIp(dcl.ValueOrEmptyBool(o.InternalIP))
p.SetProxyUrl(dcl.ValueOrEmptyString(o.ProxyUrl))
return p
}

Expand Down
8 changes: 7 additions & 1 deletion python/services/clouddeploy/beta/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,12 @@ def to_proto(self):

class TargetGke(object):

def __init__(self, cluster: str = None, internal_ip: bool = None):
def __init__(
self, cluster: str = None, internal_ip: bool = None, proxy_url: str = None
):
self.cluster = cluster
self.internal_ip = internal_ip
self.proxy_url = proxy_url

@classmethod
def to_proto(self, resource):
Expand All @@ -288,6 +291,8 @@ def to_proto(self, resource):
res.cluster = Primitive.to_proto(resource.cluster)
if Primitive.to_proto(resource.internal_ip):
res.internal_ip = Primitive.to_proto(resource.internal_ip)
if Primitive.to_proto(resource.proxy_url):
res.proxy_url = Primitive.to_proto(resource.proxy_url)
return res

@classmethod
Expand All @@ -298,6 +303,7 @@ def from_proto(self, resource):
return TargetGke(
cluster=Primitive.from_proto(resource.cluster),
internal_ip=Primitive.from_proto(resource.internal_ip),
proxy_url=Primitive.from_proto(resource.proxy_url),
)


Expand Down
2 changes: 2 additions & 0 deletions python/services/clouddeploy/beta/target_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func ProtoToClouddeployBetaTargetGke(p *betapb.ClouddeployBetaTargetGke) *beta.T
obj := &beta.TargetGke{
Cluster: dcl.StringOrNil(p.GetCluster()),
InternalIP: dcl.Bool(p.GetInternalIp()),
ProxyUrl: dcl.StringOrNil(p.GetProxyUrl()),
}
return obj
}
Expand Down Expand Up @@ -155,6 +156,7 @@ func ClouddeployBetaTargetGkeToProto(o *beta.TargetGke) *betapb.ClouddeployBetaT
p := &betapb.ClouddeployBetaTargetGke{}
p.SetCluster(dcl.ValueOrEmptyString(o.Cluster))
p.SetInternalIp(dcl.ValueOrEmptyBool(o.InternalIP))
p.SetProxyUrl(dcl.ValueOrEmptyString(o.ProxyUrl))
return p
}

Expand Down
8 changes: 7 additions & 1 deletion python/services/clouddeploy/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,12 @@ def to_proto(self):

class TargetGke(object):

def __init__(self, cluster: str = None, internal_ip: bool = None):
def __init__(
self, cluster: str = None, internal_ip: bool = None, proxy_url: str = None
):
self.cluster = cluster
self.internal_ip = internal_ip
self.proxy_url = proxy_url

@classmethod
def to_proto(self, resource):
Expand All @@ -288,6 +291,8 @@ def to_proto(self, resource):
res.cluster = Primitive.to_proto(resource.cluster)
if Primitive.to_proto(resource.internal_ip):
res.internal_ip = Primitive.to_proto(resource.internal_ip)
if Primitive.to_proto(resource.proxy_url):
res.proxy_url = Primitive.to_proto(resource.proxy_url)
return res

@classmethod
Expand All @@ -298,6 +303,7 @@ def from_proto(self, resource):
return TargetGke(
cluster=Primitive.from_proto(resource.cluster),
internal_ip=Primitive.from_proto(resource.internal_ip),
proxy_url=Primitive.from_proto(resource.proxy_url),
)


Expand Down
2 changes: 2 additions & 0 deletions python/services/clouddeploy/target_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func ProtoToClouddeployTargetGke(p *clouddeploypb.ClouddeployTargetGke) *cloudde
obj := &clouddeploy.TargetGke{
Cluster: dcl.StringOrNil(p.GetCluster()),
InternalIP: dcl.Bool(p.GetInternalIp()),
ProxyUrl: dcl.StringOrNil(p.GetProxyUrl()),
}
return obj
}
Expand Down Expand Up @@ -155,6 +156,7 @@ func ClouddeployTargetGkeToProto(o *clouddeploy.TargetGke) *clouddeploypb.Cloudd
p := &clouddeploypb.ClouddeployTargetGke{}
p.SetCluster(dcl.ValueOrEmptyString(o.Cluster))
p.SetInternalIp(dcl.ValueOrEmptyBool(o.InternalIP))
p.SetProxyUrl(dcl.ValueOrEmptyString(o.ProxyUrl))
return p
}

Expand Down
3 changes: 3 additions & 0 deletions services/google/clouddeploy/alpha/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type TargetGke struct {
empty bool `json:"-"`
Cluster *string `json:"cluster"`
InternalIP *bool `json:"internalIP"`
ProxyUrl *string `json:"proxyUrl"`
}

type jsonTargetGke TargetGke
Expand All @@ -103,6 +104,8 @@ func (r *TargetGke) UnmarshalJSON(data []byte) error {

r.InternalIP = res.InternalIP

r.ProxyUrl = res.ProxyUrl

}
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions services/google/clouddeploy/alpha/target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ components:
is the private IP address for clusters with private control-plane
endpoints and the public IP address otherwise. Only specify this option
when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
proxyUrl:
type: string
x-dcl-go-name: ProxyUrl
description: Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
to the Kubernetes server.
labels:
type: object
additionalProperties:
Expand Down
6 changes: 3 additions & 3 deletions services/google/clouddeploy/alpha/target_alpha_yaml_embed.go

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions services/google/clouddeploy/alpha/target_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,11 @@ func canonicalizeTargetGke(des, initial *TargetGke, opts ...dcl.ApplyOption) *Ta
} else {
cDes.InternalIP = des.InternalIP
}
if dcl.StringCanonicalize(des.ProxyUrl, initial.ProxyUrl) || dcl.IsZeroValue(des.ProxyUrl) {
cDes.ProxyUrl = initial.ProxyUrl
} else {
cDes.ProxyUrl = des.ProxyUrl
}

return cDes
}
Expand Down Expand Up @@ -890,6 +895,9 @@ func canonicalizeNewTargetGke(c *Client, des, nw *TargetGke) *TargetGke {
if dcl.BoolCanonicalize(des.InternalIP, nw.InternalIP) {
nw.InternalIP = des.InternalIP
}
if dcl.StringCanonicalize(des.ProxyUrl, nw.ProxyUrl) {
nw.ProxyUrl = des.ProxyUrl
}

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

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

Expand Down Expand Up @@ -2191,6 +2206,9 @@ func expandTargetGke(c *Client, f *TargetGke, res *Target) (map[string]interface
if v := f.InternalIP; !dcl.IsEmptyValueIndirect(v) {
m["internalIp"] = v
}
if v := f.ProxyUrl; !dcl.IsEmptyValueIndirect(v) {
m["proxyUrl"] = v
}

return m, nil
}
Expand All @@ -2210,6 +2228,7 @@ func flattenTargetGke(c *Client, i interface{}, res *Target) *TargetGke {
}
r.Cluster = dcl.FlattenString(m["cluster"])
r.InternalIP = dcl.FlattenBool(m["internalIp"])
r.ProxyUrl = dcl.FlattenString(m["proxyUrl"])

return r
}
Expand Down
5 changes: 5 additions & 0 deletions services/google/clouddeploy/alpha/target_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ func DCLTargetSchema() *dcl.Schema {
GoName: "InternalIP",
Description: "Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).",
},
"proxyUrl": &dcl.Property{
Type: "string",
GoName: "ProxyUrl",
Description: "Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.",
},
},
},
"labels": &dcl.Property{
Expand Down
3 changes: 3 additions & 0 deletions services/google/clouddeploy/beta/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type TargetGke struct {
empty bool `json:"-"`
Cluster *string `json:"cluster"`
InternalIP *bool `json:"internalIP"`
ProxyUrl *string `json:"proxyUrl"`
}

type jsonTargetGke TargetGke
Expand All @@ -103,6 +104,8 @@ func (r *TargetGke) UnmarshalJSON(data []byte) error {

r.InternalIP = res.InternalIP

r.ProxyUrl = res.ProxyUrl

}
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions services/google/clouddeploy/beta/target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ components:
is the private IP address for clusters with private control-plane
endpoints and the public IP address otherwise. Only specify this option
when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).
proxyUrl:
type: string
x-dcl-go-name: ProxyUrl
description: Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy)
to the Kubernetes server.
labels:
type: object
additionalProperties:
Expand Down
Loading

0 comments on commit f567e1e

Please sign in to comment.