Skip to content
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

SSH connection jelly doesn't stay selected on page refresh #79

Open
timja opened this issue May 9, 2021 · 12 comments
Open

SSH connection jelly doesn't stay selected on page refresh #79

timja opened this issue May 9, 2021 · 12 comments

Comments

@timja
Copy link
Member

timja commented May 9, 2021

Originally posted by @timja in #78 (comment)

@ckho-wkcda
Copy link

We face the same issue.

@andrei-tonita
Copy link

We have the same issue with the plugin.
Any updates on when this issue will be addressed?

@timja
Copy link
Member Author

timja commented Jul 26, 2021

Pull requests are welcome, I’m not working in this area currently, but happy to review a fix

@DatsloJRel
Copy link

I started looking into this issue, but I am new to Java and Jenkins plugin development, so it's a big learning curve.

Looking through the code and at my running system, I see that nowhere in the Jenkins master config.xml is the launchMethodType stored. I'm now trying to figure out how plugins load data from config.xml. I am assuming it's with @DataBoundSetter, but more investigation is needed, as it is not obvious to me why it isn't working currently.

@timja
Copy link
Member Author

timja commented Oct 29, 2021

The UI configuration isn't storing that field, it's supposed to be doing it based on isJnlp being true:

https://github.com/jenkinsci/azure-container-agents-plugin/blob/master/src/main/resources/com/microsoft/jenkins/containeragents/aci/AciContainerTemplate/config.jelly#L56

@DatsloJRel
Copy link

DatsloJRel commented Oct 29, 2021

Thanks @timja for the comment. However, looking at AciContainerTemplate.java, doesn't launchMethodType need to be stored in config.xml and then read so that it is not blank? Please forgive me if I am asking stupid questions.

    public boolean isJnlp() {
        return StringUtils.isBlank(launchMethodType) || launchMethodType.equals(Constants.LAUNCH_METHOD_JNLP);
    }

@timja
Copy link
Member Author

timja commented Oct 29, 2021

Yeah I think you're right, seems it's defaulted here:

this.launchMethodType = StringUtils.defaultString(launchMethodType, Constants.LAUNCH_METHOD_JNLP);

it should be getting stored in the config.xml by my reading of that. but probably never writing SSH

@DatsloJRel
Copy link

On my test Jenkins server, I added <launchMethodType>ssh</launchMethodType> into the config.xml file and then restarted Jenkins. The Config UI correctly has "SSH" shown. So reading the Config is working. The issue must be in writing out to the config.xml file.

@timja If you don't mind teaching me a bit, do you know what source file is responsible for writing out the data to config.xml?

@timja
Copy link
Member Author

timja commented Oct 29, 2021

It's done by the jelly file https://github.com/jenkinsci/azure-container-agents-plugin/blob/master/src/main/resources/com/microsoft/jenkins/containeragents/aci/AciContainerTemplate/config.jelly#L56

field="theName"

theName would be the name of the field in the source code.
It calls either the constructor or getters and setters matching the name if the field isn't in the constructor.

you might have to experiment a bit, the source for dropdownList is here:
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/lib/form/dropdownList.jelly

@wassimbelmezouar
Copy link

Hello,
We are using right now the latest tag as far: 223.vf18b5bf95fe6
The plugin can deploy containers with private IPs, but remote connection is not working because we based the containers on ssh agent and not JNLP.
It seems that that the launch method is still not saving, and Jenkins is expecting JNLP. So the build does not work because Jenkins can't connect to it.
Is there any solution or workaround?

@timja
Copy link
Member Author

timja commented Feb 16, 2022

It should still work

The plugin is used a lot more with inbound agents though

@faizan002
Copy link

It should still work

The plugin is used a lot more with inbound agents though

What could be the reason for using inbound more over ssh ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants