Skip to content

[WIP] Add hpa annotations #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions dist/origin-web-common-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,9 @@ angular.module('openshiftCommonUI')
"loggingDataPrefix": ["openshift.io/logging.data.prefix"],
"idledAt": ["idling.alpha.openshift.io/idled-at"],
"idledPreviousScale": ["idling.alpha.openshift.io/previous-scale"],
"systemOnly": ["authorization.openshift.io/system-only"]
"systemOnly": ["authorization.openshift.io/system-only"],
"hpaConditions": ["autoscaling.alpha.kubernetes.io/conditions"],
"hpaMetrics": ["autoscaling.alpha.kubernetes.io/metrics"]
};
return function(annotationKey) {
return annotationMap[annotationKey] || null;
Expand Down Expand Up @@ -1386,11 +1388,21 @@ angular.module('openshiftCommonUI')
};
})
.filter('imageStreamTagIconClass', function(imageStreamTagAnnotationFilter) {
return function(resource, /* optional */ tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
});
return function(resource, /* optional */ tagName) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spadgett ping, objections? I'm not setting anything, this is just used to get at the annotations. I could inline a similar fn, but figured this is where it should live.

var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
})
.filter('hpaConditions', function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaConditions'));
};
})
.filter('hpaMetrics', function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaMetrics'));
};
});
;'use strict';

angular
Expand Down
24 changes: 18 additions & 6 deletions dist/origin-web-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,9 @@ angular.module('openshiftCommonUI')
"loggingDataPrefix": ["openshift.io/logging.data.prefix"],
"idledAt": ["idling.alpha.openshift.io/idled-at"],
"idledPreviousScale": ["idling.alpha.openshift.io/previous-scale"],
"systemOnly": ["authorization.openshift.io/system-only"]
"systemOnly": ["authorization.openshift.io/system-only"],
"hpaConditions": ["autoscaling.alpha.kubernetes.io/conditions"],
"hpaMetrics": ["autoscaling.alpha.kubernetes.io/metrics"]
};
return function(annotationKey) {
return annotationMap[annotationKey] || null;
Expand Down Expand Up @@ -1593,11 +1595,21 @@ angular.module('openshiftCommonUI')
};
}])
.filter('imageStreamTagIconClass', ["imageStreamTagAnnotationFilter", function(imageStreamTagAnnotationFilter) {
return function(resource, /* optional */ tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
}]);
return function(resource, /* optional */ tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
}])
.filter('hpaConditions', ["annotationFilter", function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaConditions'));
};
}])
.filter('hpaMetrics', ["annotationFilter", function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaMetrics'));
};
}]);
;'use strict';

angular
Expand Down
12 changes: 11 additions & 1 deletion dist/origin-web-common.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,9 @@ loggingUIHostname:[ "openshift.io/logging.ui.hostname" ],
loggingDataPrefix:[ "openshift.io/logging.data.prefix" ],
idledAt:[ "idling.alpha.openshift.io/idled-at" ],
idledPreviousScale:[ "idling.alpha.openshift.io/previous-scale" ],
systemOnly:[ "authorization.openshift.io/system-only" ]
systemOnly:[ "authorization.openshift.io/system-only" ],
hpaConditions:[ "autoscaling.alpha.kubernetes.io/conditions" ],
hpaMetrics:[ "autoscaling.alpha.kubernetes.io/metrics" ]
};
return function(annotationKey) {
return annotationMap[annotationKey] || null;
Expand Down Expand Up @@ -784,6 +786,14 @@ return function(resource, tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return icon ? icon :"fa fa-cube";
};
} ]).filter("hpaConditions", [ "annotationFilter", function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, "hpaConditions"));
};
} ]).filter("hpaMetrics", [ "annotationFilter", function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, "hpaMetrics"));
};
} ]), angular.module("openshiftCommonUI").filter("canI", [ "AuthorizationService", function(AuthorizationService) {
return function(resource, verb, projectName) {
return AuthorizationService.canI(resource, verb, projectName);
Expand Down
24 changes: 18 additions & 6 deletions src/filters/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ angular.module('openshiftCommonUI')
"loggingDataPrefix": ["openshift.io/logging.data.prefix"],
"idledAt": ["idling.alpha.openshift.io/idled-at"],
"idledPreviousScale": ["idling.alpha.openshift.io/previous-scale"],
"systemOnly": ["authorization.openshift.io/system-only"]
"systemOnly": ["authorization.openshift.io/system-only"],
"hpaConditions": ["autoscaling.alpha.kubernetes.io/conditions"],
"hpaMetrics": ["autoscaling.alpha.kubernetes.io/metrics"]
};
return function(annotationKey) {
return annotationMap[annotationKey] || null;
Expand Down Expand Up @@ -84,8 +86,18 @@ angular.module('openshiftCommonUI')
};
})
.filter('imageStreamTagIconClass', function(imageStreamTagAnnotationFilter) {
return function(resource, /* optional */ tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
});
return function(resource, /* optional */ tagName) {
var icon = imageStreamTagAnnotationFilter(resource, "iconClass", tagName);
return (icon) ? icon : "fa fa-cube";
};
})
.filter('hpaConditions', function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaConditions'));
};
})
.filter('hpaMetrics', function(annotationFilter) {
return function(hpa) {
return JSON.parse(annotationFilter(hpa, 'hpaMetrics'));
};
});