-
Notifications
You must be signed in to change notification settings - Fork 85
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
✨ Add OCI source for provider ConfigMap preparation #683
✨ Add OCI source for provider ConfigMap preparation #683
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-operator ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
17be047
to
db4106b
Compare
e202fd3
to
ee6fbae
Compare
47baaa7
to
57b8b0b
Compare
e9def7e
to
4a773f8
Compare
bf81b3e
to
2b3ca67
Compare
2b3ca67
to
efb530f
Compare
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.
thanks a lot! I added couple comments but none of them should block merging the PR
/approve
cmd/plugin/cmd/preload.go
Outdated
} | ||
|
||
// retryWithExponentialBackoff repeats an operation until it passes or the exponential backoff times out. | ||
func retryWithExponentialBackoff(ctx context.Context, opts wait.Backoff, operation func(ctx context.Context) error) error { |
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.
can this moved to util
package or something similar?
|
||
// ociAuthentication returns user supplied credentials from provider variables. | ||
func ociAuthentication() *auth.Credential { | ||
username := os.Getenv(providercontroller.OCIUsernameKey) |
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.
should authentication be documented?
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.
Yes, I'll add documentation in the follow-up PR
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.
err = fs.Close() | ||
}() | ||
|
||
// 1. Add files to the file store |
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.
will it make sense to create some tmp directory as the file store?
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.
Not in this case as this already reads a dir/file path provided by user. There is no need to do it, the dir as well may be a temporary already.
} | ||
|
||
metadata, err := store.GetMetadata(provider) | ||
if err != 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.
if metadata is empty should we return an error?
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.
Yes, it is checked within the method. If the metadata is incorrect, it will also result in a phase error on the resource later on.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexander-demicev The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Great work, thanks. Few non-blocking suggestions inline and below:
Can we have a guide/doc around how to use the new operator plugin as part of the book content as a follow-up?
c0a51ad
to
0f25329
Compare
@Danil-Grigorev can you please re-run |
0f25329
to
3ca860e
Compare
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
Signed-off-by: Danil-Grigorev <[email protected]>
3ca860e
to
2959930
Compare
/lgtm |
LGTM label has been added. Git tree hash: b0ae962c2d7320158ae59c8975b5da530b872569
|
What this PR does / why we need it:
Allow to specify OCI artifact source for pulling the provider manifests. Similar to URL, the content is stored in a
ConfigMap
, which is used as a source of truth for the provider state.This functionality allows to pre-load provider manifests in airGapped environments.
A new operator plugin command is available:
which fetches according manifests for the provider and outputs prepared
ConfigMap
resource.To package and publish manifests, plugin
publish
subcommand can be used:oras
can be also used directly:oras push ttl.sh/${IMAGE_NAME}:v1.9.3 metadata.yaml infrastructure-components.yaml
this image is later available as a source for the
Provider
resource:Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #