Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dhslove committed Jan 10, 2025
2 parents eb68471 + fadb39e commit 36b6d77
Show file tree
Hide file tree
Showing 694 changed files with 71,644 additions and 69,584 deletions.
12 changes: 0 additions & 12 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,15 @@ MD004: false
# MD007/ul-indent Unordered list indentation
MD007: false

# MD009/no-trailing-spaces Trailing spaces
MD009: false

# MD010/no-hard-tabs Hard tabs
MD010: false

# MD012/no-multiple-blanks Multiple consecutive blank lines
MD012: false

# MD013/line-length Line length
MD013: false

# MD014/commands-show-output Dollar signs used before commands without showing output
MD014: false

# MD018/no-missing-space-atx No space after hash on atx style heading
MD018: false

# MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading
MD019: false

# MD022/blanks-around-headings Headings should be surrounded by blank lines
MD022: false

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ repos:
^systemvm/agent/certs/realhostip\.key$
- id: end-of-file-fixer
exclude: \.vhd$
#- id: fix-byte-order-marker
- id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
exclude: \.(cs|xml)$
exclude: \.cs$
- id: trailing-whitespace
files: \.(header|in|java|md|properties|py|rb|sh|sql|txt|vue|xml|yaml|yml)$
files: \.(bat|cfg|cs|css|gitignore|header|in|install|java|md|properties|py|rb|sh|sql|txt|vue|xml|xsl|yaml|yml)$
args: [--markdown-linebreak-ext=md]
exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$
- repo: https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -87,7 +87,7 @@ repos:
^setup/bindir/cloud-setup-encryption\.in$|
^venv/.*$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.40.0
rev: v0.43.0
hooks:
- id: markdownlint
name: run markdownlint
Expand Down
6 changes: 0 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ Bug ID | Description
[CLOUDSTACK-7722](https://issues.apache.org/jira/browse/CLOUDSTACK-7722) | add.label: Add button for tags show the label not "Add" text...
[CLOUDSTACK-7246](https://issues.apache.org/jira/browse/CLOUDSTACK-7246) | VM deployment failed due to wrong in script name createipalias.sh...


Version 4.4.1
-------------

Expand Down Expand Up @@ -276,7 +275,6 @@ Bug ID | Description
[CLOUDSTACK-1632](https://issues.apache.org/jira/browse/CLOUDSTACK-1632) | Mistakes in authorizeSecurityGroup* API docs...
[CLOUDSTACK-401](https://issues.apache.org/jira/browse/CLOUDSTACK-401) | Storage options missing from table...


Version 4.4.0
-------------

Expand Down Expand Up @@ -930,7 +928,6 @@ Security Fixes:

* CVE-2012-4501: Apache CloudStack configuration vulnerability


Version 4.0.2
------------------------

Expand Down Expand Up @@ -979,7 +976,6 @@ Issues fixed in this release:
* CLOUDSTACK-2090: Upgrade from version 4.0.1 to version 4.0.2 triggers the 4.0.0 to 4.0.1.
* CLOUDSTACK-2091: Error in API documentation for 4.0.x.


Version 4.0.1-incubating
------------------------

Expand Down Expand Up @@ -1023,7 +1019,6 @@ Bugs fixed in this release:
* CLOUDSTACK-961: Installation docs don't detail dependencies for building RPMs
* CLOUDSTACK-995: Not able to add the KVM host


Version 4.0.0-incubating
------------------------

Expand Down Expand Up @@ -1056,7 +1051,6 @@ Security Fixes:

* CVE-2012-4501: Apache CloudStack configuration vulnerability


Updating this file
------------------

Expand Down
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ $ git fetch upstream
$ git rebase upstream/main
```


Making changes
--------------


It is important that you create a new branch to make changes on and that you do not change the `main` branch (other than to rebase in changes from `upstream/main`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the ACS project.

It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
Expand All @@ -70,7 +68,6 @@ $ git commit -a -m "descriptive commit message for your changes"

> The `-b` specifies that you want to create a new branch called `feature_x`. You only specify `-b` the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.

Rebase `feature_x` to include updates from `upstream/main`
------------------------------------------------------------

Expand All @@ -92,7 +89,6 @@ $ git rebase main

> Now your `feature_x` branch is up-to-date with all the code in `upstream/main`.

Make a GitHub Pull Request to contribute your changes
-----------------------------------------------------

Expand All @@ -107,7 +103,7 @@ $ git push origin main
$ git push origin feature_x
```

Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.
Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.

To initiate the pull request, do the following:

Expand All @@ -118,7 +114,6 @@ To initiate the pull request, do the following:

If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.


Cleaning up after a successful pull request
-------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ New line separated list of affected versions, commit ID for issues on main branc
Information about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise
-->


##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->


##### SUMMARY
<!-- Explain the problem/feature briefly -->


##### STEPS TO REPRODUCE
<!--
For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
Expand Down
3 changes: 0 additions & 3 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ This PR...
- [ ] Minor
- [ ] Trivial


### Screenshots (if appropriate):


### How Has This Been Tested?

<!-- Please describe in detail how you tested your changes. -->
Expand All @@ -53,5 +51,4 @@ This PR...

<!-- see how your change affects other areas of the code, etc. -->


<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
44 changes: 36 additions & 8 deletions agent/src/main/java/com/cloud/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public int value() {
ServerResource _resource;
Link _link;
Long _id;
String _uuid;
String _name;

Timer _timer = new Timer("Agent Timer");
Timer certTimer;
Expand Down Expand Up @@ -182,8 +184,10 @@ public Agent(final IAgentShell shell, final int localAgentId, final ServerResour
resource.setAgentControl(this);

final String value = _shell.getPersistentProperty(getResourceName(), "id");
_uuid = _shell.getPersistentProperty(getResourceName(), "uuid");
_name = _shell.getPersistentProperty(getResourceName(), "name");
_id = value != null ? Long.parseLong(value) : null;
logger.info("id is {}", ObjectUtils.defaultIfNull(_id, ""));
logger.info("Initialising agent [id: {}, uuid: {}, name: {}]", ObjectUtils.defaultIfNull(_id, ""), _uuid, _name);

final Map<String, Object> params = new HashMap<>();

Expand Down Expand Up @@ -212,8 +216,9 @@ public Agent(final IAgentShell shell, final int localAgentId, final ServerResour
new ThreadPoolExecutor(_shell.getWorkers(), 5 * _shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(
"agentRequest-Handler"));

logger.info("Agent [id = {} : type = {} : zone = {} : pod = {} : workers = {} : host = {} : port = {}", ObjectUtils.defaultIfNull(_id, "new"), getResourceName(),
_shell.getZone(), _shell.getPod(), _shell.getWorkers(), host, _shell.getPort());
logger.info("Agent [id = {}, uuid: {}, name: {}] : type = {} : zone = {} : pod = {} : workers = {} : host = {} : port = {}",
ObjectUtils.defaultIfNull(_id, "new"), _uuid, _name, getResourceName(),
_shell.getZone(), _shell.getPod(), _shell.getWorkers(), host, _shell.getPort());
}

public String getVersion() {
Expand Down Expand Up @@ -377,11 +382,28 @@ public Long getId() {
}

public void setId(final Long id) {
logger.debug("Set agent id {}", id);
_id = id;
_shell.setPersistentProperty(getResourceName(), "id", Long.toString(id));
}

public String getUuid() {
return _uuid;
}

public void setUuid(String uuid) {
this._uuid = uuid;
_shell.setPersistentProperty(getResourceName(), "uuid", uuid);
}

public String getName() {
return _name;
}

public void setName(String name) {
this._name = name;
_shell.setPersistentProperty(getResourceName(), "name", name);
}

private synchronized void scheduleServicesRestartTask() {
if (certTimer != null) {
certTimer.cancel();
Expand Down Expand Up @@ -594,17 +616,21 @@ public void processStartupAnswer(final Answer answer, final Response response, f
return;
}

logger.info("Process agent startup answer, agent id = {}", startup.getHostId());
logger.info("Process agent startup answer, agent [id: {}, uuid: {}, name: {}] connected to the server",
startup.getHostId(), startup.getHostUuid(), startup.getHostName());

setId(startup.getHostId());
setUuid(startup.getHostUuid());
setName(startup.getHostName());
_pingInterval = (long)startup.getPingInterval() * 1000; // change to ms.

setLastPingResponseTime();
scheduleWatch(link, response, _pingInterval, _pingInterval);

_ugentTaskPool.setKeepAliveTime(2 * _pingInterval, TimeUnit.MILLISECONDS);

logger.info("Startup Response Received: agent id = {}", getId());
logger.info("Startup Response Received: agent [id: {}, uuid: {}, name: {}]",
startup.getHostId(), startup.getHostUuid(), startup.getHostName());
}

protected void processRequest(final Request request, final Link link) {
Expand Down Expand Up @@ -860,15 +886,17 @@ public void processReadyCommand(final Command cmd) {
NumbersUtil.enableHumanReadableSizes = humanReadable;
}

logger.info("Processing agent ready command, agent id = {}", ready.getHostId());
logger.info("Processing agent ready command, agent id = {}, uuid = {}, name = {}", ready.getHostId(), ready.getHostUuid(), ready.getHostName());
if (ready.getHostId() != null) {
setId(ready.getHostId());
setUuid(ready.getHostUuid());
setName(ready.getHostName());
}

verifyAgentArch(ready.getArch());
processManagementServerList(ready.getMsHostList(), ready.getLbAlgorithm(), ready.getLbCheckInterval());

logger.info("Ready command is processed for agent id = {}", getId());
logger.info("Ready command is processed for agent [id: {}, uuid: {}, name: {}]", getId(), getUuid(), getName());
}

private void verifyAgentArch(String arch) {
Expand Down
24 changes: 21 additions & 3 deletions api/src/main/java/com/cloud/agent/api/to/LoadBalancerTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,15 @@ public String getMonitorState() {
public static class CounterTO implements Serializable {
private static final long serialVersionUID = 2L;
private final Long id;
private final String uuid;
private final String name;
private final Counter.Source source;
private final String value;
private final String provider;

public CounterTO(Long id, String name, Counter.Source source, String value, String provider) {
public CounterTO(Long id, String uuid, String name, Counter.Source source, String value, String provider) {
this.id = id;
this.uuid = uuid;
this.name = name;
this.source = source;
this.value = value;
Expand All @@ -391,6 +393,10 @@ public Long getId() {
return id;
}

public String getUuid() {
return uuid;
}

public String getName() {
return name;
}
Expand All @@ -411,12 +417,14 @@ public String getProvider() {
public static class ConditionTO implements Serializable {
private static final long serialVersionUID = 2L;
private final Long id;
private final String uuid;
private final long threshold;
private final Condition.Operator relationalOperator;
private final CounterTO counter;

public ConditionTO(Long id, long threshold, Condition.Operator relationalOperator, CounterTO counter) {
public ConditionTO(Long id, String uuid, long threshold, Condition.Operator relationalOperator, CounterTO counter) {
this.id = id;
this.uuid = uuid;
this.threshold = threshold;
this.relationalOperator = relationalOperator;
this.counter = counter;
Expand All @@ -426,6 +434,10 @@ public Long getId() {
return id;
}

public String getUuid() {
return uuid;
}

public long getThreshold() {
return threshold;
}
Expand All @@ -442,15 +454,17 @@ public CounterTO getCounter() {
public static class AutoScalePolicyTO implements Serializable {
private static final long serialVersionUID = 2L;
private final long id;
private final String uuid;
private final int duration;
private final int quietTime;
private final Date lastQuietTime;
private AutoScalePolicy.Action action;
boolean revoked;
private final List<ConditionTO> conditions;

public AutoScalePolicyTO(long id, int duration, int quietTime, Date lastQuietTime, AutoScalePolicy.Action action, List<ConditionTO> conditions, boolean revoked) {
public AutoScalePolicyTO(long id, String uuid, int duration, int quietTime, Date lastQuietTime, AutoScalePolicy.Action action, List<ConditionTO> conditions, boolean revoked) {
this.id = id;
this.uuid = uuid;
this.duration = duration;
this.quietTime = quietTime;
this.lastQuietTime = lastQuietTime;
Expand All @@ -463,6 +477,10 @@ public long getId() {
return id;
}

public String getUuid() {
return uuid;
}

public int getDuration() {
return duration;
}
Expand Down
Loading

0 comments on commit 36b6d77

Please sign in to comment.