Comments (3)
This also has the more problematic limitation that vars
is incompatible with the legacy manifest format:
error: The following flags cannot be used with deprecated usage: var
This means we have to choose between the zero-downtime-deploy feature, and being able to use a single manifest per app.
from cf-resource.
This is caused by autopilot (contraband/autopilot#59) which in turn points to cf cli's API (cloudfoundry/cli#1445), finally pointing at a description of a massive refactor which has been causing problems like this for plugins (cloudfoundry/cli#1399 (comment))
The short explanation is that this line in autopilot uses the CF CLI plugin code (as it should):
But the CF CLI plugin code is stuck using legacy code, and has no way to use non-legacy.
I think the simplest fix (but likely years away) would be to continue CF CLI's existing replicate-the-world approach and add a new non-legacy plugin API which plugins can choose to switch to. Then autopilot could switch to that, and this issue should be resolved. In that case, this problem would be entirely out of the hands of the cf-resource project.
Alternatively, cf-resource could replace autopilot with a series of raw cf
commands doing exactly the same thing that the plugin is currently doing (since the CLI part of the CF CLI is using non-legacy codepaths). Translated into bash, the tasks appear to be:
APP_NAME="<app-name>";
app_state() {
cf app "$1" | grep 'requested state:' | tr -s ' ' | cut -f3 -d' ' || echo 'missing';
}
VEN_NAME="${APP_NAME}-venerable";
APP_STATE="$(app_state "$APP_NAME")";
MADE_VEN='false';
if [[ "$APP_STATE" != 'missing' ]]; then
if [[ "$APP_STATE" != 'started' ]]; then
cf delete "$APP_NAME" -f;
else
VEN_STATE="$(app_state "$VEN_NAME")";
if [[ "$VEN_STATE" != 'missing' ]]; then
cf delete "$VEN_NAME" -f;
fi;
cf rename "$APP_NAME" "$VEN_NAME";
MADE_VEN='true';
fi;
fi;
if cf push "$APP_NAME" [extra args here...]; then
if [[ "$MADE_VEN" == 'true' ]]; then
cf delete "$VEN_NAME" -f;
fi;
echo 'SUCCESS!';
else
if [[ "$MADE_VEN" == 'true' ]]; then
cf logs "$APP_NAME" --recent; # (I added this; autopilot doesn't do it)
cf delete "$APP_NAME" -f;
cf rename "$VEN_NAME" "$APP_NAME";
fi;
echo 'FAILED :(';
fi;
It would take a bit of work to translate this from bash into go, and it will make PushApp
much more complicated, but it would mean entirely bypassing CF CLI's plugin architecture, which means all these issues would go away.
from cf-resource.
Hi @ipsi thanks for pointing this issue out. As @davidje13 points out, our plugin architecture is tied to our legacy code, which does not interact nicely with refactored commands or new features. The CLI team did an exploration recently to try to get to an understanding as to how to help plugin authors but we do not have enough information to move forward, and also we want to understand how the new upcoming rolling deployments feature fits into the picture for some of the plugins which have reported issues.
Here is the tracker story for reference which includes a document detailing some of the engineers' findings. Please feel free to comment in the document.
from cf-resource.
Related Issues (20)
- can't deploy stratos UI from a pipeline HOT 2
- show_app_log should also work when not using b/g deploy HOT 1
- Setting "environment_variables" gives Deprecation warning HOT 1
- Support passing --var
- Environment variables defined in Manifest cannot be override HOT 1
- JAR output, to be used as put input HOT 1
- current_app_name behavior loses environment variables HOT 1
- Longer timeout for large applications
- Support configuring auto-scaling on push
- Boolean manifest variables don't interpret the same in pipeline vs vars file
- Pushing a big file with zero down time consistently fails. HOT 4
- Push docker image from Amazon Elastic Container Registry (ECR) HOT 2
- cf-resource to start app
- Error setting integer-based env vars of a cf resource HOT 2
- Add support for platform-native rolling app deployments HOT 2
- Read credentials from a file
- vars_files can never be resolved to paths that work HOT 3
- Enable support for cli v7 HOT 1
- Require Linux/ARM64 Docker Image for concourse/cf-resource
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cf-resource.