Skip to content

Commit

Permalink
Merge pull request #6744 from andrewballantyne/tt-annotation-issue
Browse files Browse the repository at this point in the history
Bug 1882529: Removes the kubectl annotation from the created PLRs
  • Loading branch information
openshift-merge-robot committed Sep 25, 2020
2 parents 681eda7 + bcd801c commit 2f74e8e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ export const getPipelineRunData = (
const latestRunParams = latestRun?.spec.params;
const pipelineParams = pipeline?.spec.params;
const params = latestRunParams || getPipelineRunParams(pipelineParams);
// TODO: We should craft a better method to allow us to provide configurable annotations and labels instead of
// blinding merging existing content from potential real Pipeline and PipelineRun resources
const annotations = _.merge(
{},
pipeline?.metadata?.annotations,
latestRun?.metadata?.annotations,
);
delete annotations['kubectl.kubernetes.io/last-applied-configuration'];

const newPipelineRun = {
apiVersion: pipeline ? pipeline.apiVersion : latestRun.apiVersion,
Expand All @@ -70,7 +78,7 @@ export const getPipelineRunData = (
: {
name: `${pipelineName}-${getRandomChars()}`,
}),
annotations: _.merge({}, pipeline?.metadata?.annotations, latestRun?.metadata?.annotations),
annotations,
namespace: pipeline ? pipeline.metadata.namespace : latestRun.metadata.namespace,
labels: _.merge({}, pipeline?.metadata?.labels, latestRun?.metadata?.labels, {
'tekton.dev/pipeline': pipelineName,
Expand Down

0 comments on commit 2f74e8e

Please sign in to comment.