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

Authentication required cant pull images in devfile from openshift image registry #416

Open
bd-bord1 opened this issue Oct 25, 2024 · 2 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@bd-bord1
Copy link

bd-bord1 commented Oct 25, 2024

Hi Everyone,

I followed these steps and we are still unable to pull images.

The error we are getting is authentication required. Does anyone know a solution for this?

Many thanks.

kubectl create secret docker-registry regsecret \
--docker-server=image-registry.openshift-image-registry.svc:5000 \
--docker-username=serviceaccount \
--docker-password=xxx \
--docker-email=xxx

oc edit sa pipeline
---
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
imagePullSecrets:
- name: pipeline-dockercfg-nwgfr
- name: regsecret
kind: ServiceAccount
metadata:
  creationTimestamp: "2024-08-05T08:03:10Z"
  name: pipeline
  namespace: client-prod-nbaa-devspaces
  ownerReferences:
  - apiVersion: operator.tekton.dev/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: TektonConfig
    name: config
    uid: 56ab06cd-085d-4d3a-a7e2-11412c0677c0
  resourceVersion: "149532604"
  uid: 77efc77d-c81e-4bcb-9ebf-1805f4164c94
secrets:
- name: pipeline-dockercfg-nwgfr
- name: githubtoken
- name: regsecret


---
oc adm policy add-cluster-role-to-user system:image-pusher system:serviceaccount:client-prod-nbaa-devspaces:pipeline -n acic-images

---
oc adm policy add-cluster-role-to-user system:image-builder system:serviceaccount:client-prod-nbaa-devspaces:pipeline -n acic-images
---

oc secrets link pipeline regsecret --for=pull

The manifest of devfile.yaml:


schemaVersion: 2.3.0
metadata:
  name: new-java-angular
  displayName: new-java-angular
  description: "Angular is a development platform, built on TypeScript. As a platform, Angular includes:
    A component-based framework for building scalable web applications
    A collection of well-integrated libraries that cover a wide variety of features, including routing, forms management, client-server communication, and more
    A suite of developer tools to help you develop, build, test, and update your code"
  icon:
https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/angular.svg
  tags:
    - Java
    - Node.js
    - Angular
  projectType: Angular
  language: TypeScript,Java
  provider: Red Hat
  version: 2.2.1
components:
  - container:
      endpoints:
        - name: https-java
          protocol: https
          targetPort: 8080
      image: image-registry.openshift-image-registry.svc:5000/acic-images/devspaces-imagev5:latest
      args: ["tail", "-f", "/dev/null"]
      memoryLimit: 1024Mi 
    name: java
commands:
  - id: install
    exec:
      commandLine: npm install
      component:   angular
      group:
        isDefault: true
        kind: build
      workingDir: /projects/fishing-permit-application-sourcecode/acn-hpsapf-fishingpermit-gui-angular 
  - id: run
    exec:
      commandLine: npm run start-de
      component:   angular
      group:
        isDefault: true
        kind: run
      hotReloadCapable: true
      workingDir: /projects/fishing-permit-application-sourcecode/acn-hpsapf-fishingpermit-gui-angular
  - id: mvn-build
    exec:
      component: java
      commandLine: "mvn clean install"
      workingDir:  /projects/fishing-permit-application-sourcecode/acn-hpsapf-fishingpermit-parent
  - id: mvn-run-rest-backend
    exec:
      component: java
      commandLine: "mvn spring-boot:run"
      workingDir: /projects/fishing-permit-application-sourcecode/acn-hpsapf-fishingpermit-restservices-springboot
  - id: mvn-run-legacy
    exec:
      component: java
      commandLine: "mvn spring-boot:run"
      workingDir: /projects/fishing-permit-application-sourcecode/acn-hpsapf-fishingpermitadmininistration-gui-springboot
  - id: start-shell
    exec:
      commandLine: bash
      workingDir: /projects
      component: java
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 24, 2025
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

2 participants