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

feat(ref): #1017 added name field for gitref #1022

Closed
wants to merge 1 commit into from

Conversation

haarchri
Copy link

@haarchri haarchri commented Feb 6, 2023

Signed-off-by: Christopher Paul Haar christopherpaul.haar@dkb.de
Co-Authored-by: André Kesser andre.kesser@dkb.de

implemented Name field for GitRepositoryRef wich takes precedence over all reference fields. If Name is found for both Branch and Tag, Tag is used!

implements #1017

Open:
need to implement HostKeyCallback for go-git v5:
ssh: must specify HostKeyCallback

Tests:

branch: v1.x

spec:
  gitImplementation: go-git
  interval: 5m0s
  ref:
    name: v1.x
  timeout: 60s
  url: https://github.com/stefanprodan/podinfo
kubectl get gitrepo -A 
NAMESPACE   NAME      URL                                       AGE     READY   STATUS
default     podinfo   https://github.com/stefanprodan/podinfo   1h51m   True    stored artifact for revision 'HEAD/6c8a85a5ab953874c7c83d50317359a0e5a352a9'

tag: 6.0.3

spec:
  gitImplementation: go-git
  interval: 5m0s
  ref:
    name: 6.0.3
  timeout: 60s
  url: https://github.com/stefanprodan/podinfo
kubectl get gitrepo -A 
NAMESPACE   NAME      URL                                       AGE     READY   STATUS
default     podinfo   https://github.com/stefanprodan/podinfo    1h58m   True    stored artifact for revision 'HEAD/ea292aa958c5e348266518af2261dc04d6270439'

Signed-off-by: Christopher Paul Haar <christopherpaul.haar@dkb.de>
@stefanprodan
Copy link
Member

@haarchri as discussed in #1017 the ref.name must be a Git reference which has this format:

  • branch refs/heads/main
  • tag refs/tags/v0.0.1
  • GitHub PR refs/pull/1017/head
  • GitLab MR refs/merge-requests/1017/head

To implement this, first we need to create a new checkout strategy in fluxcd/pkg/git.

@hiddeco
Copy link
Member

hiddeco commented Feb 16, 2023

Superseded by #1026

@hiddeco hiddeco closed this Feb 16, 2023
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.

None yet

3 participants