-
Notifications
You must be signed in to change notification settings - Fork 541
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(operatorinstaller): add initial deployment strategy #40
feat(operatorinstaller): add initial deployment strategy #40
Conversation
alm/operatorinstaller.go
Outdated
import ( | ||
"encoding/json" | ||
"fmt" | ||
"github.com/coreos-inc/operator-client/pkg/client" |
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.
import (
// std imports
// third party imports
// local imports
)
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.
Does the go fmt not really fix this?
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.
goimports does iirc, but i personally don't run it on save because it has corner-cases, specifically the prometheus client lib confuses it a lot
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.
return nil, err | ||
} | ||
crd := &v1beta1extensions.CustomResourceDefinition{} | ||
_, _, err = scheme.Codecs.UniversalDecoder().Decode(data, nil, crd) |
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.
these libraries suck
They use io.Writer for encoding, but []byte for decoding instead of io.Reader.
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.
8fe6dc4 so much in these packages is just so 😞 . Added comment that this is for testing things out, not production use cases.
schema/loader.go
Outdated
@@ -7,6 +7,8 @@ import ( | |||
"k8s.io/client-go/kubernetes/scheme" | |||
) | |||
|
|||
// LoadCRDFromFile is a utility function for loading the CRD schemas. | |||
// !!! WARNING !!! Not recommended for production use |
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 this is the case, we could put it in a test file
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.
that's where it was originally but it doesn't really belong in any of the packages being tested, so I put it in it's own thing for now.
Looks like there's a vendoring issue with CI |
} | ||
|
||
func deploymentFromUnstructured(d *unstructured.Unstructured) (*v1beta1.Deployment, error) { | ||
data, err := json.Marshal(d) |
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 there a reason we can't cast to a deployment here?
|
||
mockClient := client.NewMockInterface(ctrl) | ||
|
||
mockClient.EXPECT(). |
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 test the error case too
846357c
to
a7daa52
Compare
a7daa52
to
16065f9
Compare
16065f9
to
ee6916f
Compare
ee6916f
to
dabc0e7
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.
LGTM
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.
LGTM
…M-111/alm-code-skeleton-operatorversion feat(operatorinstaller): add initial deployment strategy
Add beginning of operator install strategy logic by adding the "deployment" strategy.