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

Fixing null pointer error #7

Merged
merged 6 commits into from
Nov 2, 2023
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
4 changes: 2 additions & 2 deletions flx-dev-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
initContainers:
- name: flx-driver
image: np04docker.cern.ch/dunedaq-local/flx-driver:v0.3
image: np04docker.cern.ch/ghcr/dune-daq/flx-init-driver-alma9:latest
securityContext:
privileged: true
volumeMounts:
Expand All @@ -27,7 +27,7 @@ spec:
readOnly: true
containers:
- name: flx-plugin
image: np04docker.cern.ch/dunedaq-local/flx-plugin:v0.3
image: np04docker.cern.ch/ghcr/dune-daq/flx-device-plugin:latest
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion flx-plugin/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module flx-dev-plugin

go 1.17
go 1.21

require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
Expand Down
19 changes: 13 additions & 6 deletions flx-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,29 @@ func (p *Plugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*p
}

// GetDevicePluginOptions returns options to be communicated with Device Manager
func (Plugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error) {
return nil, nil
func (p* Plugin) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error) {
fmt.Println("GetDevicePluginOptions()", p.name)

return &pluginapi.DevicePluginOptions{}, nil
}

// PreStartContainer is called, if indicated by Device Plugin during registeration phase,
// before each container start. Device plugin can run device specific operations
// such as reseting the device before making devices available to the container
func (Plugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error) {
return nil, nil
func (p* Plugin) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error) {
fmt.Println("GetDevicePluginOptions()", p.name)

return &pluginapi.PreStartContainerResponse{}, nil
}

func (dp *Plugin) GetPreferredAllocation(ctx context.Context, request *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) {
return nil, nil
func (p *Plugin) GetPreferredAllocation(ctx context.Context, request *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error) {
fmt.Println("GetPreferredAllocation()", p.name)

return &pluginapi.PreferredAllocationResponse{}, nil
}

func (l FLXLister) GetResourceNamespace() string {
fmt.Println("GetResourceNamespace()")
return resourceNamespace
}

Expand Down