Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
1ed9e04a
Unverified
Commit
1ed9e04a
authored
Dec 08, 2017
by
benjaminapetersen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update applicationsService to use getPreferredVersion
parent
623cb787
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
32 deletions
+50
-32
origin-web-common-services.js
dist/origin-web-common-services.js
+15
-6
origin-web-common.js
dist/origin-web-common.js
+15
-6
origin-web-common.min.js
dist/origin-web-common.min.js
+5
-14
applicationsService.js
src/services/applicationsService.js
+15
-6
No files found.
dist/origin-web-common-services.js
View file @
1ed9e04a
...
...
@@ -579,13 +579,22 @@ angular.module('openshiftCommonServices')
;
'use strict'
;
angular
.
module
(
"openshiftCommonServices"
).
service
(
"ApplicationsService"
,
function
(
$q
,
DataService
)
{
service
(
"ApplicationsService"
,
function
(
$q
,
APIService
,
DataService
)
{
var
deploymentsVersion
=
APIService
.
getPreferredVersion
(
'deployments'
);
var
deploymentConfigsVersion
=
APIService
.
getPreferredVersion
(
'deploymentconfigs'
);
var
replicationControllersVersion
=
APIService
.
getPreferredVersion
(
'replicationcontrollers'
);
var
replicaSetsVersion
=
APIService
.
getPreferredVersion
(
'replicasets'
);
var
statefulSetsVersion
=
APIService
.
getPreferredVersion
(
'statefulsets'
);
// List replication controllers in a namespace that are NOT managed by a
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var
listStandaloneReplicationControllers
=
function
(
context
)
{
return
DataService
.
list
(
'replicationcontrollers'
,
context
,
null
,
{
return
DataService
.
list
(
replicationControllersVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `openshift.io/deployment-config-name`
...
...
@@ -600,7 +609,7 @@ service("ApplicationsService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var
listStandaloneReplicaSets
=
function
(
context
)
{
return
DataService
.
list
(
{
group
:
'extensions'
,
resource
:
'replicasets'
}
,
context
,
null
,
{
return
DataService
.
list
(
replicaSetsVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `pod-template-hash` label, it's managed
...
...
@@ -616,11 +625,11 @@ service("ApplicationsService", function($q, DataService) {
var
promises
=
[];
// Load all the "application" types
promises
.
push
(
DataService
.
list
(
'deploymentconfigs'
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentConfigsVersion
,
context
));
promises
.
push
(
listStandaloneReplicationControllers
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'deployments'
}
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentsVersion
,
context
));
promises
.
push
(
listStandaloneReplicaSets
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'statefulsets'
}
,
context
));
promises
.
push
(
DataService
.
list
(
statefulSetsVersion
,
context
));
$q
.
all
(
promises
).
then
(
_
.
spread
(
function
(
deploymentConfigData
,
replicationControllerData
,
deploymentData
,
replicaSetData
,
statefulSetData
)
{
var
deploymentConfigs
=
_
.
toArray
(
deploymentConfigData
.
by
(
'metadata.name'
));
...
...
dist/origin-web-common.js
View file @
1ed9e04a
...
...
@@ -2614,13 +2614,22 @@ angular.module('openshiftCommonServices')
;
'use strict'
;
angular
.
module
(
"openshiftCommonServices"
).
service
(
"ApplicationsService"
,
[
"$q"
,
"DataService"
,
function
(
$q
,
DataService
)
{
service
(
"ApplicationsService"
,
[
"$q"
,
"APIService"
,
"DataService"
,
function
(
$q
,
APIService
,
DataService
)
{
var
deploymentsVersion
=
APIService
.
getPreferredVersion
(
'deployments'
);
var
deploymentConfigsVersion
=
APIService
.
getPreferredVersion
(
'deploymentconfigs'
);
var
replicationControllersVersion
=
APIService
.
getPreferredVersion
(
'replicationcontrollers'
);
var
replicaSetsVersion
=
APIService
.
getPreferredVersion
(
'replicasets'
);
var
statefulSetsVersion
=
APIService
.
getPreferredVersion
(
'statefulsets'
);
// List replication controllers in a namespace that are NOT managed by a
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var
listStandaloneReplicationControllers
=
function
(
context
)
{
return
DataService
.
list
(
'replicationcontrollers'
,
context
,
null
,
{
return
DataService
.
list
(
replicationControllersVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `openshift.io/deployment-config-name`
...
...
@@ -2635,7 +2644,7 @@ service("ApplicationsService", ["$q", "DataService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var
listStandaloneReplicaSets
=
function
(
context
)
{
return
DataService
.
list
(
{
group
:
'extensions'
,
resource
:
'replicasets'
}
,
context
,
null
,
{
return
DataService
.
list
(
replicaSetsVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `pod-template-hash` label, it's managed
...
...
@@ -2651,11 +2660,11 @@ service("ApplicationsService", ["$q", "DataService", function($q, DataService) {
var
promises
=
[];
// Load all the "application" types
promises
.
push
(
DataService
.
list
(
'deploymentconfigs'
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentConfigsVersion
,
context
));
promises
.
push
(
listStandaloneReplicationControllers
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'deployments'
}
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentsVersion
,
context
));
promises
.
push
(
listStandaloneReplicaSets
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'statefulsets'
}
,
context
));
promises
.
push
(
DataService
.
list
(
statefulSetsVersion
,
context
));
$q
.
all
(
promises
).
then
(
_
.
spread
(
function
(
deploymentConfigData
,
replicationControllerData
,
deploymentData
,
replicaSetData
,
statefulSetData
)
{
var
deploymentConfigs
=
_
.
toArray
(
deploymentConfigData
.
by
(
'metadata.name'
));
...
...
dist/origin-web-common.min.js
View file @
1ed9e04a
...
...
@@ -1213,9 +1213,9 @@ unsupportedObjectKindOrVersion:unsupportedObjectKindOrVersion,
availableKinds
:
availableKinds
,
getPreferredVersion
:
getPreferredVersion
};
}
]),
angular
.
module
(
"openshiftCommonServices"
).
service
(
"ApplicationsService"
,
[
"$q"
,
"
DataService"
,
function
(
$q
,
DataService
)
{
var
listStandaloneReplicationControllers
=
function
(
context
)
{
return
DataService
.
list
(
"replicationcontrollers"
,
context
,
null
,
{
}
]),
angular
.
module
(
"openshiftCommonServices"
).
service
(
"ApplicationsService"
,
[
"$q"
,
"
APIService"
,
"DataService"
,
function
(
$q
,
APIService
,
DataService
)
{
var
deploymentsVersion
=
APIService
.
getPreferredVersion
(
"deployments"
),
deploymentConfigsVersion
=
APIService
.
getPreferredVersion
(
"deploymentconfigs"
),
replicationControllersVersion
=
APIService
.
getPreferredVersion
(
"replicationcontrollers"
),
replicaSetsVersion
=
APIService
.
getPreferredVersion
(
"replicasets"
),
statefulSetsVersion
=
APIService
.
getPreferredVersion
(
"statefulsets"
),
listStandaloneReplicationControllers
=
function
(
context
)
{
return
DataService
.
list
(
replicationControllersVersion
,
context
,
null
,
{
http
:{
params
:{
labelSelector
:
"!openshift.io/deployment-config.name"
...
...
@@ -1223,10 +1223,7 @@ labelSelector:"!openshift.io/deployment-config.name"
}
});
},
listStandaloneReplicaSets
=
function
(
context
)
{
return
DataService
.
list
({
group
:
"extensions"
,
resource
:
"replicasets"
},
context
,
null
,
{
return
DataService
.
list
(
replicaSetsVersion
,
context
,
null
,
{
http
:{
params
:{
labelSelector
:
"!pod-template-hash"
...
...
@@ -1235,13 +1232,7 @@ labelSelector:"!pod-template-hash"
});
},
getApplications
=
function
(
context
)
{
var
deferred
=
$q
.
defer
(),
promises
=
[];
return
promises
.
push
(
DataService
.
list
(
"deploymentconfigs"
,
context
)),
promises
.
push
(
listStandaloneReplicationControllers
(
context
)),
promises
.
push
(
DataService
.
list
({
group
:
"apps"
,
resource
:
"deployments"
},
context
)),
promises
.
push
(
listStandaloneReplicaSets
(
context
)),
promises
.
push
(
DataService
.
list
({
group
:
"apps"
,
resource
:
"statefulsets"
},
context
)),
$q
.
all
(
promises
).
then
(
_
.
spread
(
function
(
deploymentConfigData
,
replicationControllerData
,
deploymentData
,
replicaSetData
,
statefulSetData
)
{
return
promises
.
push
(
DataService
.
list
(
deploymentConfigsVersion
,
context
)),
promises
.
push
(
listStandaloneReplicationControllers
(
context
)),
promises
.
push
(
DataService
.
list
(
deploymentsVersion
,
context
)),
promises
.
push
(
listStandaloneReplicaSets
(
context
)),
promises
.
push
(
DataService
.
list
(
statefulSetsVersion
,
context
)),
$q
.
all
(
promises
).
then
(
_
.
spread
(
function
(
deploymentConfigData
,
replicationControllerData
,
deploymentData
,
replicaSetData
,
statefulSetData
)
{
var
deploymentConfigs
=
_
.
toArray
(
deploymentConfigData
.
by
(
"metadata.name"
)),
replicationControllers
=
_
.
toArray
(
replicationControllerData
.
by
(
"metadata.name"
)),
deployments
=
_
.
toArray
(
deploymentData
.
by
(
"metadata.name"
)),
replicaSets
=
_
.
toArray
(
replicaSetData
.
by
(
"metadata.name"
)),
statefulSets
=
_
.
toArray
(
statefulSetData
.
by
(
"metadata.name"
)),
apiObjects
=
deploymentConfigs
.
concat
(
deployments
).
concat
(
replicationControllers
).
concat
(
replicaSets
).
concat
(
statefulSets
);
deferred
.
resolve
(
_
.
sortBy
(
apiObjects
,
[
"metadata.name"
,
"kind"
]));
}),
function
(
e
)
{
...
...
src/services/applicationsService.js
View file @
1ed9e04a
'use strict'
;
angular
.
module
(
"openshiftCommonServices"
).
service
(
"ApplicationsService"
,
function
(
$q
,
DataService
)
{
service
(
"ApplicationsService"
,
function
(
$q
,
APIService
,
DataService
)
{
var
deploymentsVersion
=
APIService
.
getPreferredVersion
(
'deployments'
);
var
deploymentConfigsVersion
=
APIService
.
getPreferredVersion
(
'deploymentconfigs'
);
var
replicationControllersVersion
=
APIService
.
getPreferredVersion
(
'replicationcontrollers'
);
var
replicaSetsVersion
=
APIService
.
getPreferredVersion
(
'replicasets'
);
var
statefulSetsVersion
=
APIService
.
getPreferredVersion
(
'statefulsets'
);
// List replication controllers in a namespace that are NOT managed by a
// deployment config. Note: This will not return replication controllers that
// have been orphaned by `oc delete dc/foo --cascade=false`.
var
listStandaloneReplicationControllers
=
function
(
context
)
{
return
DataService
.
list
(
'replicationcontrollers'
,
context
,
null
,
{
return
DataService
.
list
(
replicationControllersVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `openshift.io/deployment-config-name`
...
...
@@ -22,7 +31,7 @@ service("ApplicationsService", function($q, DataService) {
// Note: This will not return replica sets that have been orphaned by
// `oc delete deployment/foo --cascade=false`.
var
listStandaloneReplicaSets
=
function
(
context
)
{
return
DataService
.
list
(
{
group
:
'extensions'
,
resource
:
'replicasets'
}
,
context
,
null
,
{
return
DataService
.
list
(
replicaSetsVersion
,
context
,
null
,
{
http
:
{
params
:
{
// If the replica set has a `pod-template-hash` label, it's managed
...
...
@@ -38,11 +47,11 @@ service("ApplicationsService", function($q, DataService) {
var
promises
=
[];
// Load all the "application" types
promises
.
push
(
DataService
.
list
(
'deploymentconfigs'
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentConfigsVersion
,
context
));
promises
.
push
(
listStandaloneReplicationControllers
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'deployments'
}
,
context
));
promises
.
push
(
DataService
.
list
(
deploymentsVersion
,
context
));
promises
.
push
(
listStandaloneReplicaSets
(
context
));
promises
.
push
(
DataService
.
list
(
{
group
:
'apps'
,
resource
:
'statefulsets'
}
,
context
));
promises
.
push
(
DataService
.
list
(
statefulSetsVersion
,
context
));
$q
.
all
(
promises
).
then
(
_
.
spread
(
function
(
deploymentConfigData
,
replicationControllerData
,
deploymentData
,
replicaSetData
,
statefulSetData
)
{
var
deploymentConfigs
=
_
.
toArray
(
deploymentConfigData
.
by
(
'metadata.name'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment