Skip to content

Conversation

@smiyc
Copy link
Contributor

@smiyc smiyc commented Aug 2, 2025

blog about how I used Jonathan's blog post to create an override hcl.

Signed-off-by: Daniel Chambre [email protected]

smiyc added 6 commits July 27, 2025 16:12
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
@smiyc smiyc requested a review from a team as a code owner August 2, 2025 10:33
Signed-off-by: Daniel Chambre <[email protected]>
Copy link
Contributor

@jsilvela jsilvela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel. First post 🎉

There are a few corrections I've made and left as suggestions (highly suggested).
The blog post doesn't have much in the way of motivation and it simply finishes with the build command.
Maybe some narrative here would improve it. With this method, how is your flow easier? Have you been able to retire some old tooling? etc.

Also, please wrap text to 80 columns, as we generally do in CNPG documentation and website.

smiyc and others added 3 commits August 4, 2025 16:27
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
@smiyc
Copy link
Contributor Author

smiyc commented Aug 4, 2025

@jsilvela I see if I can wrap around some motivation text.

regarding the 80col thing, so no line must be longen then 80 col's?

@jsilvela
Copy link
Contributor

jsilvela commented Aug 4, 2025

It's not 100% strict. For example it's better not to mess with links. But most lines should not exceed 80 cols.

smiyc added 2 commits August 4, 2025 17:30
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
Copy link
Contributor

@jsilvela jsilvela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Much better.
I've found some typos and some places where I think coherence was broken.
Left suggestions.

smiyc and others added 8 commits August 5, 2025 21:23
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
Copy link
Contributor

@jsilvela jsilvela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few typos, the draft field, and also, do we need to change the package-lock file in this PR? Probably not, right?

Copy link
Contributor

@jsilvela jsilvela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.
The draft status and date will need to be changed, aside from that ✔️

@smiyc
Copy link
Contributor Author

smiyc commented Aug 6, 2025

finally!

draft and the date will be edited by the person merging this into main, right?

@sxd @FloorD
do you mind reviewing this?

Comment on lines 53 to 59
variable "environment" {
default = "production"
}

variable "registry" {
default = "your.repo.url/cnpg"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need this since those variables are already defined in the parent bake file =)

Copy link
Contributor Author

@smiyc smiyc Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no sir, when I remove both the variables are

$ docker buildx bake -f docker-bake.hcl -f cwd://bake_bookworm.hcl "https://github.com/cloudnative-pg/postgres-containers.git" myimage --push --builder=container --list=variables
[+] Building 0.7s (2/2) FINISHED                                                                                                                                                                                                                               docker-container:container
 => CACHED [internal] load git source https://github.com/cloudnative-pg/postgres-containers.git                                                                                                                                                                                      0.6s
 => [internal] load local bake definitions                                                                                                                                                                                                                                           0.0s
 => => reading bake_bookworm.hcl 3.15kB / 3.15kB                                                                                                                                                                                                                                     0.0s
VARIABLE        TYPE    VALUE           DESCRIPTION                                                                                                                                                                                                                                       
environment		testing		
registry		localhost:5000	
revision		

with both in place

$ docker buildx bake -f docker-bake.hcl -f cwd://bake_bookworm.hcl "https://github.com/cloudnative-pg/postgres-containers.git" myimage --push --builder=container --list=variables
[+] Building 0.7s (2/2) FINISHED                                                                                                                                                                                                                               docker-container:container
 => CACHED [internal] load git source https://github.com/cloudnative-pg/postgres-containers.git                                                                                                                                                                                      0.6s
 => [internal] load local bake definitions                                                                                                                                                                                                                                           0.0s
 => => reading bake_bookworm.hcl 3.15kB / 3.15kB                                                                                                                                                                                                                                     0.0s
VARIABLE        TYPE    VALUE                                   DESCRIPTION                                                                                                                                                                                                               
environment		testing					
registry		XXX/cnpg	
revision		

so when I remove environmen and registry from my bake file, the image will be uploaded to localhost:5000 and the subdirectory will be postgresql-testing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can modify the value no need to define the variables again :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify the value inside the hcl file?
I had a look at https://docs.docker.com/build/bake/overrides/ and that's how they override a variable inside an override file

variable "TAG" {
  default = "bar"
}

I also have tried to set it like we did for platforms in the troubleshooting session

  platforms = [
    "linux/amd64",
  ]
  environment = [
    "production",
  ]
  registry = [
    "xxx/cnpg",
  ]

but that's not working eighter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsilvela jsilvela self-requested a review August 6, 2025 21:01
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: Floor Drees <[email protected]>
Signed-off-by: Daniel Chambre <[email protected]>
@jsilvela jsilvela self-requested a review August 11, 2025 15:41
jsilvela
jsilvela previously approved these changes Aug 11, 2025
Co-authored-by: Jaime Silvela <[email protected]>
Signed-off-by: smiyc <[email protected]>
@jsilvela jsilvela self-requested a review August 20, 2025 19:54
jsilvela
jsilvela previously approved these changes Aug 20, 2025
@smiyc
Copy link
Contributor Author

smiyc commented Aug 20, 2025

@FloorD @sxd
Pls review

@sxd
Copy link
Member

sxd commented Aug 21, 2025

@smiyc can you rebase your PR on main and push again? I can't do it due to conflicts =(
@FloorD @jsilvela when we should publish this? I'll do a final review today so we can publish?

@jsilvela
Copy link
Contributor

For me this post could have been published a while ago. Given it three approvals.
On timing I defer to you guys.

sxd
sxd previously approved these changes Aug 22, 2025
Signed-off-by: Floor Drees <[email protected]>
@FloorD FloorD dismissed stale reviews from sxd and jsilvela via a0e2430 August 22, 2025 14:19
@sxd sxd merged commit 5e8bb5b into cloudnative-pg:main Aug 22, 2025
4 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 22, 2025
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: smiyc <[email protected]>
Signed-off-by: Floor Drees <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Co-authored-by: Floor Drees <[email protected]> 5e8bb5b
hars-21 pushed a commit to hars-21/cloudnative-pg.github.io that referenced this pull request Sep 1, 2025
Signed-off-by: Daniel Chambre <[email protected]>
Signed-off-by: smiyc <[email protected]>
Signed-off-by: Floor Drees <[email protected]>
Signed-off-by: Jaime Silvela <[email protected]>
Co-authored-by: Jaime Silvela <[email protected]>
Co-authored-by: Floor Drees <[email protected]>
Signed-off-by: Harshil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants