(appGUID string, revisionVersion int)
| 43 | } |
| 44 | |
| 45 | func (actor Actor) GetRevisionByApplicationAndVersion(appGUID string, revisionVersion int) (resources.Revision, Warnings, error) { |
| 46 | query := []ccv3.Query{ |
| 47 | {Key: ccv3.VersionsFilter, Values: []string{strconv.Itoa(revisionVersion)}}, |
| 48 | {Key: ccv3.PerPage, Values: []string{"2"}}, |
| 49 | {Key: ccv3.Page, Values: []string{"1"}}, |
| 50 | } |
| 51 | revisions, warnings, apiErr := actor.CloudControllerClient.GetApplicationRevisions(appGUID, query...) |
| 52 | if apiErr != nil { |
| 53 | return resources.Revision{}, Warnings(warnings), apiErr |
| 54 | } |
| 55 | |
| 56 | if len(revisions) > 1 { |
| 57 | return resources.Revision{}, Warnings(warnings), actionerror.RevisionAmbiguousError{Version: revisionVersion} |
| 58 | } |
| 59 | |
| 60 | if len(revisions) == 0 { |
| 61 | return resources.Revision{}, Warnings(warnings), actionerror.RevisionNotFoundError{Version: revisionVersion} |
| 62 | } |
| 63 | |
| 64 | versionRequirementMet, versionErr := versioncheck.IsMinimumAPIVersionMet(actor.Config.APIVersion(), MinimumCCAPIVersionForDeployable) |
| 65 | if versionErr != nil { |
| 66 | return resources.Revision{}, Warnings(warnings), versionErr |
| 67 | } |
| 68 | if versionRequirementMet == false { |
| 69 | _, deployableWarnings, deployableErr := actor.setRevisionsDeployableByDropletStateForApp(appGUID, revisions) |
| 70 | warnings = append(warnings, deployableWarnings...) |
| 71 | if deployableErr != nil { |
| 72 | return resources.Revision{}, Warnings(warnings), deployableErr |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return revisions[0], Warnings(warnings), nil |
| 77 | } |
| 78 | |
| 79 | func (actor Actor) GetEnvironmentVariableGroupByRevision(revision resources.Revision) (EnvironmentVariableGroup, bool, Warnings, error) { |
| 80 | envVarApiLink, isPresent := revision.Links["environment_variables"] |
nothing calls this directly
no test coverage detected