Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MASCORE-11744 - https://jsw.ibm.com/browse/MASCORE-11744
When the upstream configuration sets the Cluster Logging Operator install value to "false", the pipeline reports the value correctly. However, the GitOps update reports no files to add or commit.
As a result, the requested configuration change is not reflected in the GitOps repository.
Cause
The CLI code that generates the Cluster Logging Operator configuration creates cluster-logging-operator.yaml when CLUSTER_LOGGING_OPERATOR_INSTALL is "true". When the value is "false", the existing logic skips generation but does not remove a previously generated cluster-logging-operator.yaml file. If that file already exists and remains unchanged, the Git operation detects no file change to commit or push.
Solution
In image/cli/mascli/functions/gitops_cluster, add an elif branch that removes cluster-logging-operator.yaml when CLUSTER_LOGGING_OPERATOR_INSTALL is "false" and the file exists in the GitOps working directory. This makes the deletion visible to the existing Git operation so the change can be committed and pushed to the configured GitOps repository.
Testing
A local behavioral test was performed using the real gitops_cluster function from the modified CLI file. Unrelated AWS, secret-management, validation, and template operations were stubbed so the test could reach the changed branch without requiring external services.
The following cases were verified:
CLUSTER_LOGGING_OPERATOR_INSTALL=false with an existing cluster-logging-operator.yaml file: the file was deleted.
CLUSTER_LOGGING_OPERATOR_INSTALL=false with no existing cluster-logging-operator.yaml file: the file remained absent.
CLUSTER_LOGGING_OPERATOR_INSTALL=true with an existing cluster-logging-operator.yaml file: the file remained present.