Skip to content

Commit

Permalink
Merge pull request #169 from BESTSELLER/tech-review-2021
Browse files Browse the repository at this point in the history
Fixed import issue when importing project when a cache proxy is set
  • Loading branch information
wrighbr authored Dec 13, 2021
2 parents 5b144f2 + 33e88eb commit 1a72ade
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions models/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type ProjectsBodyResponses struct {
Deleted bool `json:"deleted"`
OwnerID int `json:"owner_id"`
RepoCount int `json:"repo_count"`
RegistryID int `json:"registry_id"`
CreationTime string `json:"creation_time"`
Togglable bool `json:"togglable"`
ProjectID int `json:"project_id"`
Expand Down
6 changes: 4 additions & 2 deletions provider/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ func resourceProject() *schema.Resource {
},
"registry_id": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
ForceNew: true,
Optional: true,
},
"public": {
Type: schema.TypeString,
Expand Down Expand Up @@ -69,7 +70,7 @@ func resourceProject() *schema.Resource {
Update: resourceProjectUpdate,
Delete: resourceProjectDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
StateContext: schema.ImportStatePassthroughContext,
},
}
}
Expand Down Expand Up @@ -127,6 +128,7 @@ func resourceProjectRead(d *schema.ResourceData, m interface{}) error {

d.Set("name", jsonData.Name)
d.Set("project_id", jsonData.ProjectID)
d.Set("registry_id", jsonData.RegistryID)
d.Set("public", jsonData.Metadata.Public)
d.Set("vulnerability_scanning", vuln)
d.Set("enable_content_trust", trust)
Expand Down

0 comments on commit 1a72ade

Please sign in to comment.