Skip to content

Commit

Permalink
Fix provider test.
Browse files Browse the repository at this point in the history
Don’t return error during provider configure if we can’t read server version and API list.
  • Loading branch information
sl1pm4t committed May 1, 2018
1 parent 31e9678 commit fe5384d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 9 additions & 7 deletions kubernetes/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,17 @@ func (p *kubernetesProvider) prepareDiscoveryCacheClient(d *schema.ResourceData)
start := time.Now()
vInfo, err := p.discoClient.ServerVersion()
if err != nil {
return fmt.Errorf("could not retrieve Server Version")
}
log.Printf("[INFO] Kubernetes Server [%s] Version: %s\n", p.cfg.Host, vInfo.String())
log.Println("[WARN] could not retrieve Server Version")
} else {
log.Printf("[INFO] Kubernetes Server [%s] Version: %s\n", p.cfg.Host, vInfo.String())

_, err = p.discoClient.ServerResources()
if err != nil {
return fmt.Errorf("could not retrieve APIResourceList")
_, err = p.discoClient.ServerResources()
if err != nil {
log.Println("[WARN] could not retrieve APIResourceList")
} else {
log.Printf("[DEBUG] retrieved resource list in %v\n", time.Now().Sub(start))
}
}
log.Printf("[DEBUG] retrieved resource list in %v\n", time.Now().Sub(start))
}
return nil
}
Expand Down
1 change: 0 additions & 1 deletion kubernetes/resource_kubernetes_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const deploymentsResourceGroupName = "deployments"

var deploymentsAPIGroups = []APIGroup{appsV1, appsV1beta2, appsV1beta1, extensionsV1beta1}

//var deploymentsAPIGroups = []APIGroup{appsV1, extensionsV1beta1}
var deploymentNotSupportedError = errors.New("could not find Kubernetes API group that supports Deployment resources")

func resourceKubernetesDeployment() *schema.Resource {
Expand Down

0 comments on commit fe5384d

Please sign in to comment.