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

Bug 1882529: Removes the kubectl annotation from the created PLRs #6744

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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