operator-framework / operator-framework/operator-sdk

bundle: `createdAt` field is always updated when `make bundle` is run

Open
#6,285 26 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help wanted kind/documentation language/go lifecycle/frozen
Dominant language
Go
Stars
7.7k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Bug Report

Running make bundle always updates the createdAt field even if no other updates in the bundle are present. I was hoping that createdAt would not change unless there are other changes in the bundle. I understand that this is an expected behaviour based on #6136, but it is annoying when taking git and github into account.

I plan to create a github workflow that checks if make bundle has been run, and always having one line change is not ideal. The other place where this could be an issue is when collaborating on a project. The changes in the bundle will have to be actively ignored before commiting and pushing. The git pull operation might complain that I have local changes and prevent me from pulling until they are discarded.

I understand that there are ways around it, it is just not ideal to have to deal that.

What did you do?

Run make bundle, commit all the changes.
Run make bundle again.

What did you expect to see?

I expected to see no changes in git

What did you see instead? Under which circumstances?

The line for metadata.annotations.createdAt in bundle/manifests/<name>.clusterserviceversion.yaml is changed even though there are no other changes in the bundle.

Environment

Operator type:

/language go

Kubernetes cluster type:

minikube

$ operator-sdk version

operator-sdk version: "v1.26.0", commit: "cbeec475e4612e19f1047ff7014342afe93f60d2", kubernetes version: "1.25.0", go version: "go1.19.3", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.19.4 linux/amd64

$ kubectl version

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:58:30Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.3", GitCommit:"434bfd82814af038ad94d62ebe59b133fcb50506", GitTreeState:"clean", BuildDate:"2022-10-12T10:49:09Z", GoVersion:"go1.19.2", Compiler:"gc", Platform:"linux/amd64"}
Possible Solution

Surround this with an if statement that checks if anything else has changed.

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with internal/generate/clusterserviceversion/clusterserviceversion_updaters.go at the referenced createdAt update, then run make bundle twice with no other changes. Done means the second run produces no git diff, while createdAt still updates when another bundle change is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.