-
Notifications
You must be signed in to change notification settings - Fork 6
Git Repositories #4
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
Conversation
Watch for updates to tracked GitRepositories and rereconcile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slick, tested it out, works as expected 👌
if err := mgr.GetCache().IndexField( | ||
context.TODO(), &templatesv1.GitOpsSet{}, gitRepositoryIndexKey, indexGitRepositories); err != nil { | ||
return fmt.Errorf("failed setting index fields: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! Pure optimization or required to function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is to start triggering reconciliations if the GitRepo's "change"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// NewRepositoryParser creates and returns a RepositoryParser. | ||
func NewRepositoryParser(logger logr.Logger) *RepositoryParser { | ||
return &RepositoryParser{fetcher: fetch.NewArchiveFetcher(retries, tar.UnlimitedUntarSize, tar.UnlimitedUntarSize, ""), Logger: logger} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlimited!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Interval is an implementation of the Generator interface. | ||
func (g *GitRepositoryGenerator) Interval(sg *templatesv1.GitOpsSetGenerator) time.Duration { | ||
return generators.NoRequeueInterval | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not actually be connected up to the controller-runtime yet? (which is fine for this generator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this might be a bug :-)
Lemme take a look
5220f14
to
257e9ad
Compare
result = append(result, r) | ||
} | ||
|
||
return result, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it useful to have the path too? maybe wait for a use case but could namespace the file contents? 🤔
The .element PR brought this to mind..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be .elementSpec.path
or something too if it would be useful to access that stuff.
Just musing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting idea...I like it...
.element.data
and .element.path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .element
idea is useful in context of repeat: ...
because we can expose the repeating element as .repeat
and the original element as .element
which means you can still access bits of data from the surrounding generated element.
…com/fluxcd/image-reflector-controller/api-0.31.2 Bump github.com/fluxcd/image-reflector-controller/api from 0.31.1 to 0.31.2
This implements the first part of parsing from GitRepositories.