-
Notifications
You must be signed in to change notification settings - Fork 344
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
Patch upgradeLog on the upgrade path #7660
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Jian Wang <jian.wang@suse.com>
# patch_clusteroutput | ||
echo "patch clusteroutput $upgradelogname-clusteroutput" | ||
local patchfile="patch_clusteroutput.yaml" | ||
cat > $patchfile <<EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of writing a file to disk, use the following to pipe a heredoc directly into kubectl:
cat <<EOF | kubectl [...] -f -
spec:
loggingRef: "$loggingref"
EOF
This avoids having to clean up with rm
later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes we cat the file conent for better debugging, it looks to be a bit lenthy, but does no big harm
@@ -571,6 +571,57 @@ EOF | |||
wait_for_addon_upgrade_deployment $name $namespace $enabled $curstatus | |||
} | |||
|
|||
upgrade_harvester_upgradelog_with_patch_loggingref() | |||
{ | |||
local namespace=$UPGRADE_NAMESPACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables should be qouted with "
, unless you want to risk expansion and globbing.
I can only recommend to install shellcheck as a linter for shellscripts in your IDE. It will really help your write more robust shellscripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The execution logic LGTM. But I'm a bit confused about the field loggingRef
. What does it reference to? Does the value have to be some real objects, or is it just used as a key to show the uniqueness of the Logging CR? It is even weird that the field also exists in the Logging CRD. What does it mean for a Logging CR to reference to another Logging CR? Could you kindly elaborate on that? Also, I found that the field is optional on their documentation.
https://kube-logging.dev/docs/configuration/crds/v1beta1/logging_types/#loggingspec-loggingref
Thank you.
The general design is: (1). In a system, user may deploy several groups of (2). The
(3). The technically, in the upgraded rancher-logging version, when a
The
In the When testing harvester/addons#47, I first noticed that the This rule applies to |
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Problem:
The upstream logging has some enhancements, the upgradeLog needs to adapt to them.
Solution:
This PR and #7653 enhance the upgradeLog in v1.5.0
Related Issue:
#7652
#7654
Test plan:
Upgrade v1.4.*->v1.5.0, ugpradeLog should work properly, no matter rancher-logging addon is enabled or not
local test log:
v141->v150 upgrade test, with addon rancher-logging disabled, the upgradeLog works well