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

Remove hardcoded images for Capact charts #454

Merged
merged 3 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/populator/cmd/register/ocf_manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func runDBPopulate(ctx context.Context, src string) (err error) {
log.Info("Populated new data", zap.Duration("duration (seconds)", end.Sub(start)))
}
return nil
}, retry.Attempts(3), retry.Delay(1*time.Minute))
}, retry.Attempts(6), retry.Delay(30*time.Second))
if err != nil {
return errors.Wrap(err, "while populating manifests")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
# image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.image.name }}:{{ .Values.global.containerRegistry.overrideTag | default .Chart.AppVersion }}"
# Use PR image
image: "ghcr.io/capactio/pr/k8s-engine:PR-424"
image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.image.name }}:{{ .Values.global.containerRegistry.overrideTag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: APP_GRAPH_QL_ADDR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ spec:
serviceAccountName: "{{ include "capact.fullname" . }}-test-e2e"
containers:
- name: tests-runner
# image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.integrationTest.image.name }}:{{ .Values.global.containerRegistry.overrideTag | default .Chart.AppVersion }}"
# Use PR image
image: "ghcr.io/capactio/pr/e2e-test:PR-424"
image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.integrationTest.image.name }}:{{ .Values.global.containerRegistry.overrideTag | default .Chart.AppVersion }}"
env:
- name: STATUS_ENDPOINTS
value: "http://capact-engine-graphql.{{.Release.Namespace}}.svc.cluster.local/healthz,http://capact-gateway.{{.Release.Namespace}}.svc.cluster.local/healthz,http://capact-hub-local.{{.Release.Namespace}}.svc.cluster.local/healthz,http://capact-hub-public.{{.Release.Namespace}}.svc.cluster.local/healthz"
Expand Down
29 changes: 24 additions & 5 deletions pkg/hub/client/public/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,35 @@ func (c *Client) ListInterfaces(ctx context.Context, opts ...InterfaceOption) ([
ifaceOpts := &InterfaceOptions{}
ifaceOpts.Apply(opts...)

req := graphql.NewRequest(fmt.Sprintf(`query ListInterfaces($interfaceFilter: InterfaceFilter!) {
interfaces(filter: $interfaceFilter) {
queryFields := fmt.Sprintf(`
path
name
prefix
%s`, ifaceOpts.additionalFields)

var req *graphql.Request
if ifaceOpts.filter.PathPattern != nil {
// Send query with filter only if defined.
// Sending without `interfaceFilter` or with
// {
// "interfaceFilter": {
// "pathPattern": null
// }
// }
// always results in empty response and no error.
req = graphql.NewRequest(fmt.Sprintf(`query ListInterfaces($interfaceFilter: InterfaceFilter!) {
interfaces(filter: $interfaceFilter) {
%s
}
}`, queryFields))
req.Var("interfaceFilter", ifaceOpts.filter)
} else {
req = graphql.NewRequest(fmt.Sprintf(`query ListInterfaces{
interfaces {
%s
}
}`, ifaceOpts.additionalFields))

req.Var("interfaceFilter", ifaceOpts.filter)
}`, queryFields))
}

var resp struct {
Interfaces []*gqlpublicapi.Interface `json:"interfaces"`
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = BeforeSuite(func() {
err := envconfig.Init(&cfg)
Expect(err).ToNot(HaveOccurred())

waitTillServiceEndpointsAreReady()
//waitTillServiceEndpointsAreReady()
waitTillDataIsPopulated()
})

Expand Down Expand Up @@ -81,6 +81,8 @@ func waitTillDataIsPopulated() {

Eventually(func() (int, error) {
ifaces, err := cli.ListInterfaces(context.Background())
fmt.Println(err)
fmt.Println(ifaces)
return len(ifaces), err
}, cfg.PollingTimeout, cfg.PollingInterval).Should(BeNumerically(">", 1))
}
Expand Down