Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add network and subnetwork references to Cluster #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
16 changes: 16 additions & 0 deletions apis/container/v1alpha2/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions apis/container/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions apis/container/v1alpha2/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions config/container/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ func Configure(p *config.Provider) {
}
return fmt.Sprintf("projects/%s/locations/%s/clusters/%s", project, location, externalName), nil
}
r.References["network"] = config.Reference{
Type: "Network",
Extractor: common.PathSelfLinkExtractor,
}
r.References["subnetwork"] = config.Reference{
Type: "Subnetwork",
Extractor: common.PathSelfLinkExtractor,
}
r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]interface{}) (map[string][]byte, error) {
name, err := common.GetField(attr, "name")
if err != nil {
Expand Down
46 changes: 46 additions & 0 deletions package/crds/container.gcp.jet.crossplane.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,29 @@ spec:
- enabled
type: object
type: array
networkRef:
description: A Reference to a named object.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
networkSelector:
description: A Selector selects an object.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
type: object
networkingMode:
description: Determines whether alias IPs or routes will be used
for pod IPs in the cluster.
Expand Down Expand Up @@ -1122,6 +1145,29 @@ spec:
description: The name or self_link of the Google Compute Engine
subnetwork in which the cluster's instances are launched.
type: string
subnetworkRef:
description: A Reference to a named object.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
subnetworkSelector:
description: A Selector selects an object.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
type: object
verticalPodAutoscaling:
description: Vertical Pod Autoscaling automatically adjusts the
resources of pods controlled by it.
Expand Down