diff --git a/.changelog/3374.txt b/.changelog/3374.txt new file mode 100644 index 00000000000..0c8ff3042dc --- /dev/null +++ b/.changelog/3374.txt @@ -0,0 +1,3 @@ +```release-note:bug +container: fixed importing/reading `google_container_node_pool` resources in non-RUNNING states +``` diff --git a/google/resource_container_node_pool.go b/google/resource_container_node_pool.go index 677adb7dc21..f5399e317a5 100644 --- a/google/resource_container_node_pool.go +++ b/google/resource_container_node_pool.go @@ -313,27 +313,13 @@ func resourceContainerNodePoolCreate(d *schema.ResourceData, meta interface{}) e func resourceContainerNodePoolRead(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) nodePoolInfo, err := extractNodePoolInformation(d, config) - - name := getNodePoolName(d.Id()) - if err != nil { return err } - var nodePool = &containerBeta.NodePool{} - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - nodePool, err = config.clientContainerBeta. - Projects.Locations.Clusters.NodePools.Get(nodePoolInfo.fullyQualifiedName(name)).Do() - - if err != nil { - return resource.NonRetryableError(err) - } - if nodePool.Status != "RUNNING" { - return resource.RetryableError(fmt.Errorf("Nodepool %q has status %q with message %q", d.Get("name"), nodePool.Status, nodePool.StatusMessage)) - } - return nil - }) + name := getNodePoolName(d.Id()) + nodePool, err := config.clientContainerBeta.Projects.Locations.Clusters.NodePools.Get(nodePoolInfo.fullyQualifiedName(name)).Do() if err != nil { return handleNotFoundError(err, d, fmt.Sprintf("NodePool %q from cluster %q", name, nodePoolInfo.cluster)) }