-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for google_container_attached clusters resource. - Add support for CRUD operations to attached clusters. - Add support for data source to retrieve valid attached cluster platform versions. - Add support for data source to pull a manifest for deploying the install agent to a cluster before attaching. * Split attached cluster data sources into a separate PR * Address review comments. - Add update test - Proper handling of update mask for updates - Changed logging_config handling to explicitly send an empty object if missing - Misc cleanup * Address more review comments. - Fix update test formatting - Prevent destroying containerattached resource during update test - Remove auto-format for fleet project and validate format instead - Fix error field structure Signed-off-by: Modular Magician <magic-modules@google.com> Signed-off-by: Modular Magician <magic-modules@google.com>
- Loading branch information
1 parent
71edccc
commit 54daef4
Showing
10 changed files
with
2,085 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
`google_container_attached_cluster` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package google | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"time" | ||
) | ||
|
||
type ContainerAttachedOperationWaiter struct { | ||
Config *Config | ||
UserAgent string | ||
Project string | ||
CommonOperationWaiter | ||
} | ||
|
||
func (w *ContainerAttachedOperationWaiter) QueryOp() (interface{}, error) { | ||
if w == nil { | ||
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.") | ||
} | ||
|
||
region := GetRegionFromRegionalSelfLink(w.CommonOperationWaiter.Op.Name) | ||
|
||
// Returns the proper get. | ||
url := fmt.Sprintf("https://%s-gkemulticloud.googleapis.com/v1/%s", region, w.CommonOperationWaiter.Op.Name) | ||
|
||
return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil) | ||
} | ||
|
||
func createContainerAttachedWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ContainerAttachedOperationWaiter, error) { | ||
w := &ContainerAttachedOperationWaiter{ | ||
Config: config, | ||
UserAgent: userAgent, | ||
Project: project, | ||
} | ||
if err := w.CommonOperationWaiter.SetOp(op); err != nil { | ||
return nil, err | ||
} | ||
return w, nil | ||
} | ||
|
||
// nolint: deadcode,unused | ||
func containerAttachedOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { | ||
w, err := createContainerAttachedWaiter(config, op, project, activity, userAgent) | ||
if err != nil { | ||
return err | ||
} | ||
if err := OperationWait(w, activity, timeout, config.PollInterval); err != nil { | ||
return err | ||
} | ||
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response) | ||
} | ||
|
||
func containerAttachedOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error { | ||
if val, ok := op["name"]; !ok || val == "" { | ||
// This was a synchronous call - there is no operation to wait for. | ||
return nil | ||
} | ||
w, err := createContainerAttachedWaiter(config, op, project, activity, userAgent) | ||
if err != nil { | ||
// If w is nil, the op was synchronous. | ||
return err | ||
} | ||
return OperationWait(w, activity, timeout, config.PollInterval) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.